CMD Simulator
Advanced System Toolswinget

Winget Command: Windows Package Manager Syntax and Examples

Master the Windows winget command. Learn how to search, install, upgrade, and manage software packages from the command line in this comprehensive 2026 guide.

Admin··Updated Mar 27, 2026
Share

The winget command is the official Windows Package Manager command-line utility that enables you to discover, install, upgrade, remove, and configure software applications directly from the Command Prompt or PowerShell. By automating the download and installation of applications, winget saves substantial time compared to manually downloading installers from web browsers.

Whether you're provisioning a new development machine, updating all your installed applications with a single command, or scripting software deployments across hundreds of enterprise endpoints, mastering the winget command transforms how you manage Windows software. IT professionals, developers, and power users rely on winget to streamline app management and ensure software is always up-to-date and secure.

This comprehensive guide covers winget syntax, parameters, practical examples for searching and installing software, troubleshooting common package errors, and a detailed frequently asked questions section. By the end, you'll confidently manage your Windows applications from the command line.

What Is the Winget Command?

Winget (Windows Package Manager) is an open-source project managed by Microsoft that brings Linux-style package management to Windows 10 and Windows 11. It interacts with configured sources (repositories), primarily the official Microsoft community repository and the Microsoft Store, to fetch package manifests. These manifests contain the metadata, download links, and installation switches required to seamlessly deploy software.

Syntax

The winget command requires a specific subcommand (or verb) followed by relevant options and the target package identifier.

winget <command> [[-q] [<query>]] [<options>]
winget install <App_ID> [options]
winget upgrade <App_ID> [options]
winget search <query> [options]
ParameterDescription
installInstalls the specified application.
upgradeUpgrades an installed application to the latest version.
searchSearches for applications matching the query.
listDisplays the applications currently installed on your system.
uninstallUninstalls the specified application.
exportExports a list of installed applications to a JSON file.
importInstalls all the applications listed in an exported JSON file.
--silentRuns the installer quietly (suppresses GUI prompts).

Parameters / Options

Installing Applications (install)

The install command fetches the latest installer and runs it. You can specify the exact ID of the application (e.g., Microsoft.PowerToys) or a general search term. It is best practice to use the exact --id to ensure you are installing the correct publisher's software.

Batch Upgrades (upgrade --all)

The upgrade subcommand checks your installed software against the repository. By appending --all, winget will automatically download and install updates for every supported application on your machine.

Discovering Software (search)

Before installing, you use search to check if a package exists in the repository and to find its exact exact formatting. It queries the descriptive name, tags, and the unique identifier.

Examples

1. Searching for an Application

Before installing an app, you should find its exact ID to avoid downloading a similar-sounding but incorrect package.

winget search "Node.js"

Output:

Name    Id             Version Match   Source
---------------------------------------------
Node.js OpenJS.NodeJS  18.17.0         winget
Node.js OpenJS.NodeJS  20.5.0          winget

Explanation: This command searches the configured repositories for "Node.js". The table shows the exact Id (OpenJS.NodeJS), which you will use for installation.

2. Installing an Application

Once you know the ID, you can initiate the installation.

winget install --id OpenJS.NodeJS -e --silent

Output:

Found Node.js [OpenJS.NodeJS] Version 18.17.0
This application is licensed to you by its owner.
Downloading https://nodejs.org/dist/...
Successfully installed

Explanation: The --id specifies the exact package. The -e (exact) flag ensures no fuzzy matching occurs. The --silent flag attempts to run the installation without graphical wizards.

3. Upgrading All Installed Software

This is one of the most powerful features of winget.

winget upgrade --all

Output:

Found VLC media player [VideoLAN.VLC] Version 3.0.18
Downloading...
Successfully installed
1 upgrade(s) completed

Explanation: Winget compares local versions with repository versions and updates everything it securely can without user intervention.

4. Uninstalling an Application

To quickly remove an application without digging through the Control Panel.

winget uninstall --name "Google Chrome"

Explanation: Winget locates the uninstall string registered with the OS and executes it.

5. Listing Installed Packages

To see exactly what winget is tracking on your system.

winget list

Explanation: This outputs a massive table of everything installed, including apps that were not originally installed via winget (though it can only upgrade apps if they have a matching repository ID).

6. Exporting Your Setup

Perfect for provisioning a new developer machine.

winget export -o C:\temp\my-apps.json

Explanation: Creates a JSON file of all your winget-managed installed packages. You can then run winget import -i C:\temp\my-apps.json on a new PC to install everything automatically!

Common Use Cases

  1. New PC Provisioning: Instead of spending hours hunting down installers, users run a single winget import file to install browsers, tools, and runtimes instantly.
  2. Scheduled Updates: IT admins create scheduled tasks that run winget upgrade --all --silent weekly to ensure all third-party software stays patched against vulnerabilities.
  3. CI/CD Build Agents: Developers use winget in GitHub Actions or Azure DevOps to guarantee a specific tool version is installed before building code.
  4. Standardized Workspaces: Using exact --id and --version tags to ensure everyone on a development team runs the exact same compiler versions.
  5. Silent Uninstalls: Cleaning up bloatware securely across an enterprise using winget uninstall.

Tips and Best Practices

  • Always Validate the ID: Searching for "VLC" might return dozens of entries. Always look for the VideoLAN.VLC ID to avoid installing untrusted clones.
  • Run as Administrator: Many installers (like runtimes and drivers) require elevated privileges. Running winget from an elevated prompt prevents mid-installation UAC popups that break silent deployments.
  • Understand --silent vs --interactive: Some installers stubbornly ignore the --silent flag. If an installation appears hung, try reinstalling with --interactive to see if a hidden prompt is waiting for input.
  • Check Update Availability: Run winget upgrade (without the --all flag) just to see a list of what can be updated before actually committing to it.
  • Accepting Source Agreements: The first time you run winget, you must accept the terms. Use --accept-source-agreements and --accept-package-agreements in scripts to automate past this.

Troubleshooting Common Issues

"winget is not recognized as an internal or external command"

Problem: The command prompt cannot find winget. Solution: Winget is deeply tied to the "App Installer" package from the Microsoft Store. Go to the Store, update or install "App Installer," and reboot. Ensure it is added to your PATH.

"Installer failed with exit code"

Problem: The installation exits abruptly with a seemingly random integer. Solution: Winget merely downloads and executes a publisher's installer (like an MSI or InnoSetup). The exit code comes from that installer. Usually, this means the software is already running, or the MSI requires a reboot.

"No applicable update found"

Problem: You run upgrade --all, but an app you know has an update isn't updated. Solution: The vendor might not have published the new manifest to the winget repository yet, or the installed version ID doesn't perfectly match the repository ID.

"Multiple packages found matching input criteria"

Problem: winget install python fails because it doesn't know which Python to install. Solution: Use the exact ID. For example: winget install --id Python.Python.3.11 -e.

Related Commands

PowerShell (PackageManagement)

Before winget, PowerShell utilized PackageManagement (formerly OneGet). Winget is now the preferred modern standard for Windows app deployment.

choco (Chocolatey)

Chocolatey is a massive third-party package manager ecosystem. Winget is Microsoft's official response. While Chocolatey requires third-party scripts, winget strictly reads manifests and runs native vendor installers.

PowerShell

Winget operations integrate well into larger scripting workflows using Windows PowerShell to loop over multiple machines.

Frequently Asked Questions

What does the winget command do?

The winget command discovers, installs, upgrades, and uninstalls applications on Windows entirely from the command line, connecting to the Microsoft community repository.

How do I use winget to update all my apps?

Open Command Prompt and enter winget upgrade --all. It will scan your system and install the latest versions of any supported packages.

Is winget safe to use?

Yes, winget is an official Microsoft tool. However, the community repository accepts submissions from everyone. Manifests are scanned by SmartScreen and antivirus, but always verify the publisher's ID before installing.

Can winget update portable apps?

Generally, no. Winget relies heavily on software that writes entries to the Windows Registry's "Uninstall" keys during installation. Purely portable apps aren't tracked.

How do I uninstall software with winget?

Run winget list to find the exact name or ID of the software, and then execute winget uninstall --id <AppID>.

Can I install older versions using winget?

Yes. You can append the version switch like so: winget install --id OpenJS.NodeJS --version 18.17.0 to pin a specific release.

Does winget require Administrator privileges?

The winget executable does not require admin rights, but the installers it downloads often do. For system-wide apps, you must run winget in an elevated prompt.

How do I fix a broken winget installation?

If winget stops working, open the Microsoft Store, navigate to your Library, and force an update on the "App Installer" application.

Can I use winget to manage Microsoft Store apps?

Yes. Winget queries both the primary winget repository and the msstore source. It can trigger UWP installations natively.

How do I export my installed apps to a new PC?

Run winget export -o apps.json on the old PC, copy the file over, and execute winget import -i apps.json on the new one.

Quick Reference Card

CommandPurposeExample
winget search <query>Find Application IDLocate software before installing
winget install --id <ID>Install ApplicationInstall exact package quietly
winget upgrade --allUpdate EverythingPatch all outdated software
winget listView Current AppsSee what is already installed
winget export -o <file>Backup App ListProvision a new environment

Summary

The winget command is completely revolutionizing Windows administration by standardizing software delivery directly via the command line. By abstracting the tedious process of hunting down MSI and EXE files across the web, it brings a highly efficient, Linux-like package management experience to Microsoft systems.

In this guide, we explored how to search for software using exact IDs, execute silent install operations, and effortlessly patch security vulnerabilities using the upgrade --all directive. We also looked at exporting configurations for automated PC provisioning and how to read common exit codes.

By integrating winget into your daily workflow, you drastically minimize manual setup time and guarantee your applications are standardized and secure. Mastering this command is now a mandatory skill for any modern Windows power user or systems administrator.