How to install software using cmd
Today, there are multiple guides on how to install software on a remote computer using cmd. One of the quickest routes is by running commands directly on the system’s command prompt.
This method is a useful alternative if you want to deploy several apps simultaneously, avoid running a standard GUI-based installation wizard, or install software on a remote computer in your network without user interaction.
In this guide, we’ve compiled all the information you’ll need to install software through cmd successfully.
Getting ready to install software from the command line
Before you begin the cmd procedure to install software, it’s important you have everything you need to make the installation a success. To do so, here’s a short list we’ve compiled to help you remotely install software cmd efficiently:
- • Administrator privileges: Log in as an administrator; else, have the administrator account password on the target remote PC if it’s not in the same domain.
- • Installation packages: Download .msi files of all the applications you want to install and then write down the full path to their location.
- • Firewall settings: Ensure that the firewall on the remote computer does not block “File and Printer sharing” traffic on port TCP 445.
Install from cmd on a local machine
Here’s a brief breakdown of how to install software with cmd:
- Open the Start menu and type “cmd.exe.”
- Next, right-click “cmd.exe” from the “Programs” list, then proceed to click “Run as administrator.”
- After that, type the full path to the file’s directory after the “cd” command. For example, \cd C:\users\admin\desktop.
- Type this command and then press “Enter”:
Where “filename.msi” is the name of your file.
Install software remotely using cmd
To remotely install software using cmd, follow these steps:
- Open a command prompt as an administrator;
- Copy the MSI package on the remote computer using this command:
copy c:\users\username\downloads\APP.msi \\ENDUSER-PC\C$
Here, “APP.msi” is the name of your installation package, and “ENDUSER-PC” is the remote computer’s name.
Furthermore, you can also use the remote computer IP address rather than the computer name.
- When in the command prompt, change the current directory to “C:\SysInternals” with the following command (you may need to download Windows Sysinternals Tools first):
- Then, run the following command to start installing the app on the remote computer:
PsExec.exe \\ENDUSER-PC\ -i -s msiexec.exe /i "c:\APP.msi" /qn /norestart
The PSExec command will launch the .msi installer on the remote computer. This, in turn, will install your app in quiet mode (/qn) without user interaction.
Using cmd Windows Package Manager (winget)
With the Windows Package Manager, you can easily research, download, install, update, and remove apps on Windows 11 or 10 installations with Command Prompt. This command-line tool reduces the number of steps it would have taken using a different method.
Single app installation via winget:
- Open the Start menu.
- Search for Command Prompt, then right-click the top result.
- From the menu pane, select the Run as administrator option.
- Then, type the following command to install an app with the winget command and press Enter:
winget install "APP-NAME"
Remember to change “APP-NAME” for your actual app’s name. In addition, you only need quotation marks when the name consists of multiple words with spaces. For example, to install HelpWire, the command will be widget install HelpWire.
Multiple apps installation:
- Click on Start.
- Search for the Command Prompt.
- Next, right-click on the top result to select Run as administrator option.
- Type this command to install multiple apps with the winget command and press Enter:
- winget install “APP-NAME-1” -e && winget install “APP-NAME-2” -e
- The next step is optional: Type the following command to install multiple apps by ID and press Enter:
- winget install –id=APP-NAME-1 -e && winget install –id=APP-NAME-2 -e
When in the commands, remember to change the “APP-NAME-1” and “APP-NAME-2” for the names of the apps you’re installing. If you need to process more app installations, simply add a space and && along with the app installation command.
Install software via cmd on multiple remote machines using WMIC
WMIC (Windows Management Instrumentation Command-Line) is a potent tool that allows you to remotely install software cmd easily. Unfortunately, the tool doesn’t see much use due to a lack of easily accessible documentation.
In this section, we’ll extensively examine the most straightforward method: an MSI installation file that requires no options to be located on each remote user’s local drive. Let’s dive right in.
- Load up the command shell with the appropriate access permissions:
Runas /user:DomainAdminAccount@DOMAIN cmd
… these permissions will prompt us for the credentials of our DomainAdminAccount. Once authentication is complete, we’ll be handed a command shell that runs as the Admin.
- Next, step into WMIC by entering the following command:
(We could have easily jumped into WMIC directly from the run-as command… this just helps us to break out the steps)
- Call the installation for a list of machines using the WMIC’s ability to handle a flat text file as input. These inputs allow the nodes to run installations on a list of machines (in our earlier example, it’s stored on the admin’s local hard drive in C:\computers.txt) by running the following command:
/node::@c:\computers.txt product call install true,",c:\PathToYour\File.msi
This command will iterate through the list in computers.txt… and skip over invalid nodes (e.g., the machine is turned off). After that, it’ll ask for an installation confirmation for each machine.