sodcalculator

10 Tech How-To

Install Windows Apps from Command Line

Guide 10-33312 · Updated · Step by step

This guide shows you how to find and install Windows applications directly from the command line using built-in tools like winget and choco. You’ll learn to search, install, and manage apps without opening the Microsoft Store or a web browser, which is especially handy for automation or quick setups.

What You’ll Need

  • Windows 10 (version 1809 or later) or Windows 11
  • An internet connection
  • Administrator rights (for most installs)
  • Command Prompt, PowerShell, or Windows Terminal

Step-by-Step

  1. Open a command-line interface. Press Win + X and select “PowerShell (Admin)” or “Command Prompt (Admin)”. If you prefer, search for “cmd” or “PowerShell” in the Start menu, right-click, and choose “Run as administrator”.
  2. Check if winget is available. Type winget --version and press Enter. If you see a version number, you’re ready. If not, install it from the Microsoft Store (search “App Installer”) or download the latest version from the official Microsoft website.
  3. Search for an app. Use winget search followed by a keyword. For example, winget search "visual studio code" or winget search vlc. This lists matching packages with their ID, source, and version.
  4. Identify the exact package ID. Look at the “Id” column in the search results. It’s usually in the format Publisher.AppName, like Microsoft.VisualStudioCode. Using the exact ID avoids ambiguity.
  5. Install the app. Run winget install --id (replace with the actual ID). For example: winget install --id Microsoft.VisualStudioCode. Add --accept-package-agreements --accept-source-agreements to skip prompts.
  6. Wait for the installation to complete. The command will download and install the app, showing progress in the terminal. Once done, you’ll see a success message.
  7. Verify the installation. Run winget list to see installed packages, or simply launch the app from the Start menu.
  8. Use alternative tools if needed. If winget doesn’t have the app, you can use Chocolatey. Install it first by running 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')) in an admin PowerShell. Then search with choco search and install with choco install -y.
  9. Update apps from the command line. To update all packages, run winget upgrade --all. For a specific app, use winget upgrade --id .
  10. Uninstall apps. Use winget uninstall --id to remove an application.

Common Mistakes

  • Not running as administrator. Many installs require elevated rights. If you get an access denied error, close and reopen the terminal as admin.
  • Using the wrong package name. Searching for “VLC” might return multiple results. Always use the exact --id from the search output.
  • Ignoring source agreements. Some sources (like the Microsoft Store) require you to accept terms. Use the --accept-source-agreements flag to avoid being stuck.
  • Typing the ID with spaces. IDs have no spaces; if you copy from the terminal, make sure there are no extra characters.
  • Forgetting to update winget itself. An outdated winget might not find newer apps. Run winget upgrade --id Microsoft.AppInstaller to update it.

Tips

  • Use wildcards in search. For example, winget search "*notepad*" finds all packages with “notepad” in the name.
  • Export your installed apps. Run winget export -o apps.json to save a list. You can reinstall them on a new PC with winget import -i apps.json.
  • Silent installs. Add --silent to avoid any UI prompts during installation. Not all apps support it, but many do.
  • Check the source. Use --source winget to restrict to the winget repository, or --source msstore for the Microsoft Store. This can speed up searches.
  • Create aliases. In PowerShell, you can create a function like function Install-App { winget install --id $args[0] } to shorten the command.

Troubleshooting

  • “winget is not recognized” – This means winget isn’t installed or the PATH is not set. Install the App Installer from the Microsoft Store, or download the latest .msixbundle from Microsoft’s GitHub releases.
  • “No package found matching input criteria” – Check the spelling, try a broader search, or use winget search --source winget to search only the community repo.
  • Install fails with “Hash mismatch” – This is often a temporary issue. Try again after a few minutes, or use winget install --id --force to bypass the hash check (use with caution).
  • “The parameter is incorrect” – This can happen if you use a malformed ID. Copy the ID directly from the search output, not from memory.
  • Chocolatey install fails – Ensure you’re in an admin PowerShell and that the execution policy allows scripts. If you get a TLS error, run the security protocol line again.
  • App installs but doesn’t appear – Some apps require a restart or a log-off. Check the Start menu after restarting.

Frequently Asked Questions

Can I install apps from the Microsoft Store using the command line?

Yes, winget can install apps from the Microsoft Store. Use winget install --id --source msstore. You may need to accept agreements.

What if the app I want isn’t in winget?

Try Chocolatey or the app’s official website. You can also request the package on the winget repository.

Is it safe to use winget?

Yes, winget is an official Microsoft tool. Packages come from trusted sources like the Microsoft Store or verified repositories, but always review the source before installing.

Can I install multiple apps at once?

Yes, you can chain commands like winget install --id App1 && winget install --id App2 in PowerShell, or use a script.

How do I update all apps with one command?

Run winget upgrade --all to update all installed packages that have updates available.

Does winget work on Windows 10?

Yes, winget works on Windows 10 version 1809 and later, and on Windows 11. Install the App Installer to get it.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →