Skip to main content

Update all out-of-date Windows programs in batch

· 2 min read
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

Update all out-of-date Windows programs in batch

Use the winget tool to install and manage applications

If you're working under Linux or WSL, you know very well the sudo apt-get update && sudo apt-get upgrade instruction to ask the operating system to upgrade programs present on your disk with newer version.

Under Windows, since a few years (starting with Windows 10), there is such command too: it's winget.

By running winget upgrade --all --silent in a DOS (or Powershell) console started with admin rights, you'll start a process that will scan (in a second) your computer, detect which programs are installed on it and check if a newer version exists (and known by winget).

Starting winget

Then, because we've added the --all --silent flags, we just allow winget to process to the updates without asking confirmation. Let the computer do his work during a few minutes and... tadaaa... you've fresh and updated versions of your software (the ones supported by winget).

Running winget

Winget has detected that 17 software should be upgraded and, one by one, will download and install newer versions.

Easy no?

Including unknown ones

Marc Dechèvre tells me that winget upgrade --all --silent command found 29 updates to make on his machine and that adding the --include-unknown flag found 15 more.

Getting the list of softwares

Running winget list returns the list of all softwares installed on your machine and winget list --upgrade-available only those when a newer version is available on the internet.

And, to get the list sorted, make sure you're under PowerShell and run this command instead: winget list --upgrade-available | Sort-Object. The result isn't really nice but, at least, application names are sorted.

Upgrade just one application

By running winget upgrade Docker f.i. you'll upgrade only that one.