Windows

The Quickest Way to Install Windows Software: The Command Prompt

Rahul Saigal Updated 12-12-2019

Installing apps on Windows is a time-consuming process. The user has to go through a series of steps to patch the software—search for the recent version of an app, download the installer file, manually install the app (next, next several times), and uncheck unwanted bundleware or ads.

Advertisement

The problem does not end here. Software installers in Windows have entirely different ways of setting up apps, registry, and configurations. With so many combinations, many people don’t want to go through the hassle of updating dozen or more apps. We’ll show you how to install software using the command prompt.

Solution: Chocolatey (Package Manager)

A package manager is a collection of tools to automate the entire process of installing, configuring, and updating apps. The package consists of software binaries, configuration files, and metadata. The metadata, in turn, has all the details of an app (name, description, version number, and more) and the list of dependencies to make it work properly.

Although there are many package managers for Windows, none of them has the simplicity and security of Chocolatey. With few bits of code, you can deploy the app in every system and also track or manage updates of that software over time.

Here are some reasons why we prefer Chocolatey:

  • It has the largest online database of Windows packages. As of now, there are 11,166 community-maintained packages. You can even install packages from NuGet and MyGet.
  • Package submissions go through a rigorous moderation review process, including package validation, verification, virus scanning with VirusTotal, and more. For an organization, the use of the community package repository is optional.
  • 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.
  • Chocolatey can even work with installed apps. It can take over existing application files in the Programs directory and also handle uninstalls. However, it depends on the packaging and software installer used.

Installing Chocolatey in Windows 10

Chocolatey installation is quick and intuitive. You don’t need a thorough knowledge of the Command Prompt or PowerShell. However, you must fulfill the basic system requirements and have the patience to install a few scripts.

Advertisement

System Requirements

  • Windows 7+/Windows Server 2003+ and above
  • PowerShell v2+ and above
  • .NET framework 4+ (the installation will try to install .NET 4.0 if you don’t have it installed)
  • Free space for Chocolatey CLI and another 1GB+ or more for installing packages

PowerShell Method

Press Win + X and select Windows PowerShell (Admin). At first, you must ensure Get-ExecutionPolicy is not restricted.

Type in Get-ExecutionPolicy, if it returns Restricted then that means you cannot install any script. To bypass it, type in Set-ExecutionPolicy AllSigned and “Y” to confirm the change.

bypass execution policy in PowerShell

Copy-and-paste the command

Advertisement
Set-ExecutionPolicy Bypass -Scope Process -Force; iex 
((New-Object 
System.Net.WebClient).DownloadString('https://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 \chocolatey\lib (though there may be an exceptions for .MSI installers).

You can also set up a custom installation path for packages like Python, Ruby, or Node.

Advertisement

chocolatey installation folder

Once Chocolatey gets installed, restart the PowerShell and type in choco /? to see the list of commands.

invoke choco help to get the list of commands

Command Prompt Method

If you use the command prompt, press Win + X and choose Command Prompt (Admin). Then, copy-and-paste the command

Advertisement
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe"
-NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex
((New-Object
System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))"
&& SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

Press Enter.

install chocolatey through command prompt

Chocolatey will get installed on your system in a few seconds. Restart the prompt and type in choco /? to see the list of commands.

Chocolatey Packages

Chocolatey packages are modified .nupkg files. It is a compiled zip file carrying the package metadata (including version information, dependencies, and distribution rights). If you delete the metadata specific to chocolatey, the package file is similar to NuGet.

The interesting part of Chocolatey is the community repository of packages known as the community package repository. Every package submitted to the database undergoes a rigorous moderation process before it goes live.

On the left side, you’ll see the links to the package maintainer, validation check button in colors green, red, and yellow, and instructions to install the app. Under the Install section, you’ll see the command instructions to install Google Chrome.

chocolatey package in detail

In the same section, there are instructions to upgrade and uninstall the app. The Version History menu lists all the versions, including their changelog. And there is a section on Virus Scan Results, in case you’re not confident of installing a particular app.

details of a particular package

How to Install Software Using Command Prompt or PowerShell

You probably have a list of frequently used apps you install on Windows. Instead of having to visit a website and using an installer, launch PowerShell and type in the syntax

choco install [app name]

“choco” is the short name of Chocolatey. Whenever you install, upgrade, or uninstall any app, you must prefix it with “choco.” The second prefix is the actual command. Since we’re installing the app, we’ll use the prefix “install.” The third prefix is the software name.

Navigate to the chocolatey package site and search for the app. Notice the command line instruction to install that app.

installing app through chocolatey

For example, to install Gimp, type in

choco install gimp

This will download and install the app to your system, 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. Once your app gets installed, you’ll find it in the Start menu.

installing gimp through chocolatey

Search Your Package

You can even search for a particular package with syntax

choco search [app name]

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

choco search 7-zip

When you 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 repository package website whenever you need any help.

use the chocolatey search for a particular package

Upgrading a Package

To upgrade an app, type in

choco upgrade [app name]

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

Uninstall a Package

If you don’t find an app useful, you can uninstall it through Chocolatey. Type in

choco uninstall [app name]

In most cases, the commands mentioned above are all you will ever need. But chocolatey has many more functions. Visit the command references page for more details.

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.

Modern OS’es provide you automated installer packages and commands that install many bits of software at once. But have you ever thought what is happening behind the scene when you run that installer? If this interests you, read this piece to find out how does software installation works on Windows, macOS, and Linux This Is How Software Installers Work on Windows, macOS, and Linux Modern operating systems provide you with easy methods to set up new applications. But what actually happens when you run that installer or issue that command? Read More .

Related topics: Command Prompt, Computer Maintenance, Windows Tips, Windows Tricks.

Affiliate Disclosure: By buying the products we recommend, you help keep the site alive. Read more.

Whatsapp Pinterest

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. Anthony
    December 18, 2019 at 5:23 am

    I don’t think installing software is difficult and a problem that needs a solution. Everything I’ve ever encountered gives you the option of an install location or just which drive, and the option to not install Chrome or Acrobat Reader or something else, if you don’t want them or already have them.

  2. dragonmouth
    December 12, 2019 at 10:40 pm

    For years I have heard the Windows Faithful telling the world that command line is only for the Linux nerds that still live in their parents basements. Windows is SOOO much better because everything can be done graphically. Now a MUO article recommending not only package managers but command line package managers no less. What is this world coming to?!

  3. Jay
    December 16, 2014 at 3:15 pm

    Chocolatey is more like package management, not just to install app/software. The difference: Chocolatey handle package dependencies (app that needs another app to run, example try to install Git) and updates (Ninite can update app also, but not as easy as typing "cup all"). And both of them suffer from keeping packages up to date.

    If CLI is not your cup of tea and you are only want to install software, then use Ninite. Feature wise, Chocolatey can do more than Ninite.

  4. likefunbutnot
    December 16, 2014 at 1:49 pm

    Both Chocolatey and Ninite have a place. Choco supports updating Flash, which is great for people who don't have a legacy ninite executable that includes it. Choco is also far more script-able, which is great in a managed environment. On the other hand, it's possible to give someone a ninite icon and tell them to click on it once a week. 98% of my users would never, ever drop to a command line to do anything for themselves; ninite definitely wins on user agency.

    Some Chocolatey installations aren't completely scripted. This can be both a good and a bad thing. I very much appreciate that I can step through the Avast install manually with Choco, but if I'm in a hurry it might be something I don't have time to do.

    Also, sometimes Chocolatey installs aren't as up to date as ninite's.