WINGET - Package Manager

Maintained on

Installing an app usually means finding the official site, downloading an installer, and clicking “Next” through a wizard. Doing that for every app takes time.

With winget (Windows Package Manager), you can search for, install, update, and remove apps from Command Prompt.

What is winget?

winget is a command-line package manager for Windows. On Windows 11 and recent versions of Windows 10, it is included as part of the “App Installer” package.

First, check that it works in Command Prompt.

winget --version
- □ ×
Command Prompt Icon
Command Prompt
Microsoft Windows [Version xx.x.xxxxx.xxx]
(c) 2026 Ribbit App Development All rights reserved.
 
C:\users\user>winget --version
v1.9.25200
C:\users\user>

If a version number appears, you are ready to go (the number varies by environment). If you see a message saying that ‘winget’ is not recognized as an internal or external command, update “App Installer” from the Microsoft Store.

Do I need administrator rights?

winget itself runs in a normal Command Prompt. However, some apps show an administrator prompt (UAC) during installation. To handle system-wide installs without interruption, start Command Prompt as administrator by following

.

Main commands

CommandDescription
winget search nameSearch for an app
winget show IDShow detailed information about an app
winget install IDInstall an app
winget listList installed apps
winget upgradeList apps that have updates available
winget upgrade IDUpdate a specific app
winget uninstall IDUninstall an app
winget export / importSave the app list, and restore from it

Searching for an app

winget search vscode
- □ ×
Command Prompt Icon
Command Prompt
Microsoft Windows [Version xx.x.xxxxx.xxx]
(c) 2026 Ribbit App Development All rights reserved.
 
C:\users\user>winget search vscode
Name Id Version
--------------------------------------------------------------
Visual Studio Code Microsoft.VisualStudioCode 1.xx.x
…
C:\users\user>
おすすめ書籍※ 広告を含む場合があります
中小企業経営者のためのRPA入門 RPA導入を成功させる方法

中小企業経営者のためのRPA入門 RPA導入を成功させる方法

60分でわかる! AIエージェント 超入門

60分でわかる! AIエージェント 超入門

コマンドラインの黒い画面が怖いんです。

コマンドラインの黒い画面が怖いんです。

知識・才能ゼロでもらく~に月10万円稼ぐ! よくわかるAI副業超入門

知識・才能ゼロでもらく~に月10万円稼ぐ! よくわかるAI副業超入門

The output shows the name, ID, version, and more. In later commands it is safest to use the ID, which usually follows the format Publisher.AppName.

About the output

The columns and versions in search results vary by winget version and over time. The output above is only an example.

Installing an app

winget install --id Microsoft.VisualStudioCode -e

--id specifies the ID, and -e (--exact) limits matches to the exact ID or name. Without it, partial matches can produce several candidates and cause an error.

On the first install, you may be asked to agree to the terms of the source (where packages are distributed from). Type Y to continue.

Common options

OptionDescription
-e, --exactMatch the name or ID exactly
--id IDSpecify the ID
-s, --source nameSpecify the source to search (for example winget)
--version versionInstall a specific version
-h, --silentInstall without showing the installer UI
--accept-package-agreementsAutomatically accept the package license
--accept-source-agreementsAutomatically accept the source terms

To run without prompts, combine them like this:

winget install --id Git.Git -e --silent --accept-package-agreements --accept-source-agreements
Review the terms before auto-accepting

--accept-package-agreements automates agreeing to a license. Do not use it for apps whose terms you have not read.

Checking installed apps

winget list

Apps installed by other methods also appear in the list. You can filter by name.

winget list git

Updating apps

Show the apps that have updates available:

winget upgrade

To update only one app, specify its ID.

winget upgrade --id Git.Git -e

To update everything that has an update, use --all.

winget upgrade --all
チェック

winget upgrade shows the number of available updates at the end. Review the list first, then run --all for peace of mind.

Apps with an unknown version

Apps whose version cannot be determined may be skipped by a normal winget upgrade --all. You can add --include-unknown if you need them, but unintended apps may be updated, so review the list first.

Uninstalling an app

winget uninstall --id Git.Git -e

Saving the app list and restoring it on another PC

export and import are useful when you replace a PC or set one up again.

Write_installed_apps_to_apps.json
winget export -o apps.json
Install_everything_in_apps.json_on_another_PC
winget import -i apps.json

apps.json is a JSON file that records the IDs of apps available from a source. Apps that are not registered in a source cannot be restored.

Check the file before you import

If you import a JSON file from someone else as is, every app listed in it is installed. Always check the contents first.

Automating with a batch file

Here is an example batch file for setting up a new PC.

setup_apps.cmd
@echo off
for %%I in (Git.Git Microsoft.VisualStudioCode 7zip.7zip) do (
    echo Installing %%I ...
    winget install --id %%I -e --silent --accept-package-agreements --accept-source-agreements
    if errorlevel 1 echo [Warning] winget returned an error for %%I.
)
echo Done.
pause
About exit codes

winget returns 0 on success. However, it may also end with a non-zero exit code when, for example, the app is already installed or no update is available. Treat the warning in the example above as a rough guide: it may also appear for apps that are already installed. For exit codes in general, see

.

Troubleshooting

  • An error appears when searching a source (such as msstore): Run winget source update and try again.
  • It says multiple apps were found: Add -e and specify the ID, or check the ID with winget search.
  • You do not know the ID: Look it up with winget search app-name.

Summary

GoalCommand
Find an appwinget search name
Installwinget install --id ID -e
See available updateswinget upgrade
Update everythingwinget upgrade --all
Uninstallwinget uninstall --id ID -e
Save and restore the listwinget export -o file / winget import -i file

Quiz

Practice Problem

Which command updates all installed apps that have updates available?

Choose one answer.

  1. winget upgrade --all
  2. winget update --every
  3. winget install --all
#Command Prompt #WINGET #Package Manager #Install #Command