Windows install programs from command line

Installing apps on Windows takes up a lot of time. Install and update your apps through the command prompt with this method.

Installing apps on Windows is a time-consuming process. The user has to search for the recent app version, download the installer file, then manually install the app (next, next several times), and uncheck unwanted bundleware.

The problems do not end here. Software installers in Windows have different ways of setting up apps, registries, and configurations. With so many combinations, people simply avoid the hassle of updating apps. We’ll show you how to install software using the command prompt (CMD) in Windows 10.

Solution: Chocolatey (Package Manager)

According to Microsoft Docs, a package manager consists of command-line tools and a set of services to automate the entire software management process. The package consists of software binaries, configuration files, and metadata. And the metadata, in turn, has the app details and the list of dependencies to make it work properly.

Till now, Windows OS lacked a comprehensive package manager. The launch of WinGet with new features and bug fixes (version 1.1) has raised some new doubts. It makes sense to ask, why you should choose a third-party package manager called Chocolatey? Here are some reasons:

  • If you’re using Winget, at times, you’ll need to click through a setup wizard or security prompt, which diminishes the benefit of having a command-line tool.
  • Uninstall support, in comparison to Chocolatey, is still rudimentary. Sometimes it fails to manage dependencies.
  • Only a few packages support upgrades on testing. It was unable to update apps, even though a newer version was available.
  • A package manager can run scripts, provide server management, centralized reporting, custom configuration, and more. Winget can only handle few formats, like EXE, MSIX, and MSI.
  • Chocolatey works with over 20+ installer technologies for Windows. It knows how to set up an app, registry, manage files and configuration, or any combination.

Installing Chocolatey in Windows 10

To install Chocolatey, you must fulfill the basic system requirements and have the patience to install a few scripts:

System Requirements for Chocolatey

Before you jump in, ensure your PC meets the following:

  • Windows 7+/Windows Server 2003+ and above.
  • PowerShell v2+ (minimum is v3 for install from this website due to TLS 1.2 requirement).
  • .NET framework 4+ or above.
  • Free space for Chocolatey CLI and a few GB’s for installing packages.

Installing Programs Using the PowerShell Method

Press Win + X and select Windows PowerShell (Admin). Then, you must ensure that Get-ExecutionPolicy is not restricted. Read our guide on PowerShell to know its importance.

If it returns Restricted, then run Set-ExecutionPolicy AllSigned or Set-ExecutionPolicy Bypass -Scope Process. Press Y to confirm the change.

bypass execution policy in powershell

Then, copy-paste the command:

 Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) 

Press Enter.

install chocolatey through powershell

Within a few moments, Chocolatey will get installed and create a new folder in Program Data. All the packages go to chocolateylib (there may be exceptions for .MSI installers). Once Chocolatey gets installed, restart the PowerShell and type in choco -? to see the list of commands.

chocolatey installation folder file explorer

Installing Programs Using the Command Prompt Method

Press Win + X and choose Command Prompt (Admin). Then, copy-and-paste the command:

 @"%SystemRoot%System32WindowsPowerShellv1.0powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%chocolateybin" 

Press Enter. Restart the prompt and type in choco -? to see the list of commands.

install chocolatey through command prompt

Chocolatey Packages

Chocolatey packages are a modified NuGet package. It is a compiled .nupkg file that consists of package metadata and additional data specific to Chocolatey. The package repository website has a huge collection of apps, and you can use them to install popular apps for Windows 10.

Every package submitted to the database undergoes a rigorous moderation process before it goes live. They include package validation, verification, virus scanning with VirusTotal, and more. On the left side, you’ll see the links to the package maintainer, validation check button in green, red, and yellow.

chocolatey package in detail

Under the Individual section, you’ll see the command to install, upgrade, or uninstall the app. The Version History list all the versions, including their changelog. At last, the section under Dependencies lists all the additional components required for an app.

How to Install Software Using Command Prompt or PowerShell

You have to follow some basic rules of syntax to install software from the command-line tool. The structure looks like

 choco [command][package name] 

“choco” is the short name of Chocolatey. The second prefix is the actual command, and the third is your app. Once you get into the habit, you’ll no longer have to consult the command reference list for software management.

Here are some popular commands, which you’ll frequently use. We’ll take the example of installing the GIMP image editor.

Install a Package

Head to the repository package site and search for GIMP. Then, type in:

 choco install gimp 

The command will download and install the app without requiring any action on your part. You’ll see the progress information in the console itself. In a few cases, your app might show windows, but that’s perfectly normal. Chocolatey will take care of all the installation steps automatically.

installing gimp through chocolatey

Uninstall a Package

Type in:

 choco uninstall gimp 

If an app has a list of dependencies, then Chocolatey will automatically remove those components from your system.

Search Your Package

You can even search for a particular package with this syntax:

 choco search [package name] 

For example, if you wish to install 7-zip, type in:

 choco search 7-zip 

Press Enter. Chocolatey will search for every app with the word “zip” in its database. If it’s there, you’ll find it in the results. Searching for a particular app requires a bit of practice.

use the chocolatey search for particular package

Upgrading a Package

To upgrade an app, type in:

 choco upgrade [package name] 

For example:

 choco upgrade gimp 

List of Outdated Packages

It’s also possible to see the list of all outdated apps. To make this work, you must install apps through Chocolatey. Type in:

 choco outdated 

outdated chocolatey packages Is There a Chocolatey GUI?

While the command-line tool is the preferred method for managing apps, some of you may like an actual app. Chocolatey GUI enables you to install, uninstall, update, and search for packages in a single place. To install it, type in:

 choco install chocolateygui 

To check for updates:

 choco upgrade chocolateygui 

As you launch the app, you’ll see two options in the left pane. This PC, as the name suggests, consists of packages installed on your PC. At the top-left is the search box and options to check for outdated packages, update all packages at once, and toggle between list/tile view.

Chocolatey is the remote package repository. At the top, you’ll see options to filter apps by version, include beta-release, popularity, and more.

chocolatey gui

To update a single package, right-click it and choose Update. You can export the currently installed packages (as a .config file) with their version number and installation date. You can use this file to install packages on another machine.

update chocolatey package through gui

Install Your Next App With the Command Prompt

Many people still find it a hassle to update their apps. Chocolatey lets you install a dozen or more apps with just a few keystrokes. You can easily manage your apps without any security concerns or bundleware.

Installing applications and programs on your Windows computer just became much easier. Rather than running individual .EXE files to install applications, and then going through the installation wizard, you can install an app or program using the command line with a single cmdlet.

Microsoft released the Winget command line package manager a few years back, which can be used to install, remove, and upgrade apps and programs on a Windows PC directly from Command Prompt or Windows PowerShell. However, there were a few limitations with the tool, which is why today we will talk about Chocolatey – a third-party package manager.

This post illustrates why it is convenient to use Chocolatey instead of Winget, and how to use it to make our lives easier and install applications with a single cmdlet.

Table of contents

  • What is Chocolatey
  • Winget VS Chocolatey
  • Prerequisites for Chocolatey
  • How to Install Chocolatey
    • From PowerShell
    • From Command Prompt
  • Chocolatey Packages
  • How to Install Application using Chocolatey
  • How to Upgrade Application using Chocolatey
  • How to Unisntall Application using Chocolatey
  • Closing Words

What is Chocolatey

Chocolatey is a command-line package manager that automates the processes involved in installing, uninstalling, and upgrading applications on your computer. Not only that, but it can also obtain and perform many other functions using the different parameters, which we have discussed further down this post.

A package manager uses the information inside a package, which usually includes software binaries, configuration files, images and icons, and other metadata. The manager is then responsible for using that data and correctly performing the assigned task.

Chocolatey uses its own vast library of application packages that are basically modified NuGet packages to install and upgrade applications. Since it has its own library, the available packages can be browsed through here. This package repository also gives the cmdlets needed to install, uninstall, or upgrade the different apps.

But how is Chocolatey different from Winget? Let’s find out.

Winget VS Chocolatey

As we mentioned, Winget had a few limitations to its installation capabilities, which Chocolatey does not.

Winget only supports the following types of installation packages:

  • EXE
  • INNO
  • NULLSOFT
  • MSI
  • APPX
  • MSIX
  • BURN

However, Chocolatey supports the following packages on top of the ones supported by Winget:

  • Binary packages
  • PowerShell command packages
  • Development (.DEV) packages
  • Roadmap (Virutal packages)

Other than this, Chocolatey may be the wiser choice because of these facts:

  • You often have to make a few clicks here and there when using Winget to install an app.
  • The unisntallation process f Chocolatey is more reliable as it does not leave out any dependencies.
  • Winget is occasionally unable to upgrade installed applications.

With these few issues in Winget, we would suggest you opt for Chocolatey to manage your apps and programs. Let us now address the elephant in the room and discuss how to install and use Chocolatey. But before you do, ensure your system meets these minimum requirements.

Prerequisites for Chocolatey

  • Operating System: Windows 7 or Server 2003 and above.
  • PowerShell Version 3 or above.
  • .NET 4 or above.

Chocolatey can be installed using both the Command Prompt as well as Windows PowerShell.

From PowerShell

Perform the following steps to install Chocolatey using PowerShell:

  1. Open PowerShell with administrative rights.
  2. Now set the script execution policy to AllSigned using this cmdlet:
    Set-ExecutionPolicy AllSigned
    AllSigned
  3. To confirm, enter A.
    all
  4. Now paste the following scrip in PowerShell to install Chocolatey:
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
  1. Chocolatey will now be installed.
    pwsh 1If asked for a confirmation, enter A.

You can then confirm that Chocolatey has been installed by navigating to the following using File Explorer:

C:ProgramDatachocolatey

From Command Prompt

If you would rather prefer the Command Prompt, here is how to install it:

  1. Open the Command Prompt with administrative privileges.
  2. Now paste the following command to begin installing Chocolatey:
@"%SystemRoot%System32WindowsPowerShellv1.0powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%chocolateybin"
  1. Chocolatey will now install.
    cmd 3
    Once the installation completes, close the Command Prompt and then reopen it use Chocolatey.

You can use the cmdlet choco -? to see what commands you can use with Chocolatey.

choco

View Chocolatey commands

Chocolatey is now successfully installed. Let us now show you how to use it.

Chocolatey Packages

Before we move on to installing any apps, we ought to know what can be installed and what can’t, since only the packages in the Chocolatey repository can be installed.

For that, you can open the Chocolatey packages library and search from the top of the page for your desired app.

Search for Chocolatey packages

Search for Chocolatey packages

If you find your desired app, you can click on it to obtain more information, such as whether a reboot may be required, if the package has been scanned for malware, etc.

Information on Chocolatey package

Information on Chocolatey package

If you scroll down, you will also find the different tabs labeled Install, Upgrade, and Uninstall. These tabs state the cmdlet needed to perform the task for this particular package.

Commands to perform tasks

Commands to perform tasks

Alternatively, you can also search for an app using this cmdlet in PowerShell or Command Prompt while replacing AppName with the keyword for the app:

Choco Search AppName

search 2

Search for app with Chocolatey from command line

Let us now continue to see how to use Chocolatey to manage apps and programs from the command line.

How to Install Application using Chocolatey

To install an app, you must use the following cmdlet once Chocolatey has been installed using the guide given above in elevated Command Prompt or PowerShell:

Choco Install PackageName

You must replace PackageName with the name of the app. If there is confusion, you can refer to the Chocolatey package repository and look for the installation cmdlet. Here is an example:

Choco Install adobereader

install 4

Installing app using Chocolatey

The respective application will now be installed and is ready to use.

How to Upgrade Application using Chocolatey

To upgrade an installed application, use the following cmdlet in elevated Command Prompt of PowerShell:

Note: If an app is not already installed when running the upgrade cmdlet, Chocolatey will automatically install the app and its update.

Choco Upgrade PackageName

You must replace PackageName with the name of the app. Here is an example:

Choco Upgrade microsoft-edge

upgrrade

Application upgraded with Chocolatey

How to Unisntall Application using Chocolatey

Uninstalling an app with Chocolatey is just as convenient as installing one. Use the following command in elevated Command Prompt or PowerShell while replacing PackageName with the name of the app that you want to remove:

Choco Uninstall PackageName

Here is an example:

Choco Uninstall adobereader

uninstall 1

Uninstall app using Chocolatey

Closing Words

Chocolatey is an excellent command-line utility that saves time and can automate the installation/uninstallation process without having the user make any clicks. This is especially useful if the same applications need to be installed on bulk devices.

Chocolatey can perform many other operations using the different switches, such as list outdated applications so you can upgrade them, get information on a specific package, fetch other package information, etc.

After using Chocolatey, would you ever go back to Winget? If so, then why?

Also see:

Subhan Zafar is an established IT professional with interests in Windows and Server infrastructure testing and research, and is currently working with Itechtics as a research consultant. He has studied Electrical Engineering and is also certified by Huawei (HCNA & HCNP Routing and Switching).

Scoop

Features
|
Installation
|
Documentation


Code Size

Repository size

Scoop Core CI Tests

Discord Chat

Gitter Chat

License

Scoop is a command-line installer for Windows.

What does Scoop do?

Scoop installs programs from the command line with a minimal amount of friction. It:

  • Eliminates permission popup windows
  • Hides GUI wizard-style installers
  • Prevents PATH pollution from installing lots of programs
  • Avoids unexpected side-effects from installing and uninstalling programs
  • Finds and installs dependencies automatically
  • Performs all the extra setup steps itself to get a working program

Scoop is very scriptable, so you can run repeatable setups to get your environment just the way you like, e.g.:

scoop install sudo
sudo scoop install 7zip git openssh --global
scoop install aria2 curl grep sed less touch
scoop install python ruby go perl

If you’ve built software that you’d like others to use, Scoop is an alternative to building an installer (e.g. MSI or InnoSetup) — you just need to zip your program and provide a JSON manifest that describes how to install it.

Installation

Run the following command from a non-admin PowerShell to install scoop to its default location C:Users<YOUR USERNAME>scoop.

iwr -useb get.scoop.sh | iex

Advanced installation instruction and full documentation of the installer are available in ScoopInstaller/Install. Please create new issues there if you have questions about the installation.

Documentation

Multi-connection downloads with aria2

Scoop can utilize aria2 to use multi-connection downloads. Simply install aria2 through Scoop and it will be used for all downloads afterward.

By default, scoop displays a warning when running scoop install or scoop update while aria2 is enabled. This warning can be suppressed by running scoop config aria2-warning-enabled false.

You can tweak the following aria2 settings with the scoop config command:

  • aria2-enabled (default: true)
  • aria2-warning-enabled (default: true)
  • aria2-retry-wait (default: 2)
  • aria2-split (default: 5)
  • aria2-max-connection-per-server (default: 5)
  • aria2-min-split-size (default: 5M)
  • aria2-options (default: )

Inspiration

  • Homebrew
  • sub

What sort of apps can Scoop install?

The apps that install best with Scoop are commonly called «portable» apps: i.e. compressed program files that run stand-alone when extracted and don’t have side-effects like changing the registry or putting files outside the program directory.

Since installers are common, Scoop supports them too (and their uninstallers).

Scoop is also great at handling single-file programs and Powershell scripts. These don’t even need to be compressed. See the runat package for an example: it’s really just a GitHub gist.

Contribute to this project

If you’d like to improve Scoop by adding features or fixing bugs, please read our Contributing Guide.

Support this project

If you find Scoop useful and would like to support ongoing development and maintenance, here’s how:

  • PayPal (one-time donation)

Known application buckets

The following buckets are known to scoop:

  • main — Default bucket for the most common (mostly CLI) apps
  • extras — Apps that don’t fit the main bucket’s criteria
  • games — Open source/freeware games and game-related tools
  • nerd-fonts — Nerd Fonts
  • nirsoft — Almost all of the 250+ apps from Nirsoft
  • sysinternals — Sysinternals Suite and all individual application from Microsoft
  • java — A collection of Java development kits (JDKs), Java runtime engines (JREs), Java’s virtual machine debugging tools and Java based runtime engines.
  • nonportable — Non-portable apps (may require UAC)
  • php — Installers for most versions of PHP
  • versions — Alternative versions of apps found in other buckets

The main bucket is installed by default. To add any of the other buckets, type:

scoop bucket add bucketname

For example, to add the extras bucket, type:

Other application buckets

Many other application buckets hosted on Github can be found in the Scoop Directory or via other search engines.

How To Install Program Via Command Prompt (installation logs)

When you install program on a Windows-based computer, you may receive some error messages depending on a specific system. To avoid these errors, please do the following:

1) If your installation file has *.EXE extension then start to install the program. If it has *.MSI extension, go to pt.4 .

2) When the error occurs do not close error message

3) Go to “C:|Users|<username>|AppData|Local|Temp” and find MSI installation file of the program. It will be located inside one of subfolders with GUID name like

C:|Users|<username>|AppData|Local|Temp|{045E8043-9247-4D62-A811-3241A9744CE5}

4) Copy MSI installation file of program to the root directory C:

5) Rename the file to “install.msi

6) Open Start Programs – Accessories – right click on Command Prompt and select “Run as Administrator”, or type in windows search cmd. In command line type: cd / (press Enter) to get to the root C:>

7) Run command:
msiexec /i install.msi /l*vx log.txt

Installation will start and create log file. Please complete install wizard. If installation process fails this way please send “log.txt” file to our support team. You will find it in the root directory C: next to the installation file of the program.

While you wait for answer from support team, you can try to troubleshoot this issue by yourself  – open log.txt file with any text editor and search for entry “value 3” (please note that log language depends on your system language – so its “value 3” in English but for example in French log its “valeur 3″).  This entry indicates the end of installation process log and right before this entry you will be able to find the cause of unsuccessful installation with error codes/names. Then you can find solution for most common errors in this article.

Alignment Tool, Backup & Recovery, Disk Wiper, Drive Copy, Hard Disk Manager™ for Windows, HFS+ for Windows, HowTos: Paragon, HowTos: Windows, Know how: Paragon, Know how: Windows, KnowHow: Installation, Migrate OS to SSD, Partition Manager
Tags: general, howto, installation, logs, msi, windows

Loading…

Short-Description: Installing software is now made easy. Do it the Geek’s way using command prompt and quickly install a software on your windows PC with less time consumption and by using just three words. 

So, you know how to install a Software? Of course. Just download the installer file, open it then clicking next several times, untick unwanted toolbars and hit finish. Don’t you think this is pretty annoying and consumes more time?Now, what if I tell you can install a software instantly by just using “three” words. Oh c’mon Ab don’t mess around with us just show us the method you’re talking about. That’s what you’d be probably saying.

install-software-instantly-command-prompt

Well, I’ll just show you how I download and Install a software by using just three words and doing nothing else.

Installing Software instantly

I’m going to use here a Machine Package manager called chocolatey. Also, Command prompt with Admin access in which i’ll run the Chocolatey installation commands. Here I’ll be installing notepad++. So, here’s the demo in screenshots. (I’ve explained everything below the demo.)

1) Open command Prompt with administrator permissions and i’ll type in choco install notepadplusplus.

installing-software-notepadplusplus-1

2) Hit Enter and let the package manager find the installation file, download it and install it automatically without disturbing me in the other work that I was doing on my PC.

installing-software-notepadplusplus-2

installing-software-notepadplusplus-3

Well, that’s it! Notepad++ is installed on my hard drive. All I did was type in three words and hit enter. The easiest and best way to install a software. Now, let me explain me what actually I did above step by step with full explanation. And this time you’ll do it step by step.

How to Quickly install Software using Chocolatey

Step-1: Install Chocolatey

Go to the chocolatey’s official website. Copy the code given in the first box as shown below in the screenshot. (Installation process of choco is also available on their homepage.)

install-choco-package-manager-1

After that you’ve copied the code from their site. Open command prompt with admin access. Right click on windows icon for more options.

command-prompt-admin-access

Now paste the code into command prompt by right clicking and hit paste.

choco-installation-2

After pasting the code hit Enter and the installation of chocolatey package manager should start. You need not to do anything, it’ll install itself. After the installation is complete you’ll need to close the command prompt and open it again to make Chocolatey work.

Step-2: Finding a Software Package to install

Now, that you’ve installed you need to find the software package that you want to download. We’ll take the above example of Notepad++.

Well, as I said just three words, but those three should be clearly prefect while typing in. No spelling mistake or mistyping the command. I’ll explain the keywords first.

choco : This calls the chocolatey package manager. Command prompt tells the package manager to wake up for the work.

install : This is a command that is to be given to the package manager. It’s pretty simple we want the package manager to install a software. So install keyword is used. (There are many commands you can use more given down below.)

notepadplusplus : Now this the package name that we want to install and chocolatey can identify the package only if we add this keyword. Not notepad++ or NotepadPlusPlus. It’ll give error.

So, how to find the package name that you want to download? For that there’s another command  search. So, if you want to find package name for notepad++ type in:

choco search notepad++

Or else just you can use just notepad to get broader search results. Also, you can find packages on their website too. So, that way you can find any package you want to find and install. And make sure you don’t mistype the keywords. You can also add version number to download specific version of that software.

Step-3: Type in Command and Hit Enter

Now all you have to do is type in the command to install.

choco install notepadplusplus

And Hit enter! That’s all you have to do. The software will be installed in Program files (x86) folder if it is 32 bit software or in the Program Files folder if it is 64 bit.

Update and Uninstalling Software

Now that you’ve installed the software how can you update or uninstall it? Even updating and uninstalling is simple. To update a particular software type:

chocolatey update packageName

Or else you can simply type “cup” instead of “chocolatey update”.

cup packageName

Also, you can update everything that installed on your PC. Using,

cup all

Well, I think you can now guess what will be the command to uninstall a program.

chocolatey uninstall packageName

Now, if you want to know more of it commands and functions. Type,

chocolatey /?

This will show you all of it’s information, commands and examples.

Now, just go play with it and have fun!  Also, do let me know in the comments about chocolatey, how helpful it is and what stuff you downloaded?

Also Read: 

He’s a PC Geek, Android Nerd, Programmer and a Thinker. He likes reading inspiring stories and to learn new scriptures. In his spare time, you’ll find him looking for different ways to automate his Tech.

Понравилась статья? Поделить с друзьями:
  • Windows git скачать через командную строку
  • Windows insider как стать участником windows 11
  • Windows insider windows 11 download for windows
  • Windows git ssl certificate problem unable to get local issuer certificate
  • Windows insider program ничего не отображается