Windows Update from the Command Line: CMD and PowerShell Commands

Laptop showing lines of commands, like running Windows Update from PowerShell

Quick answer: Windows has no single official “update now” command, but you can do almost everything from the command line. Run start ms-settings:windowsupdate-action to open Windows Update and start a check, use the free PSWindowsUpdate PowerShell module to list and install updates without the Settings app, install a downloaded update package with wusa.exe, and update your apps with winget upgrade --all.

Applies to: Windows 11 and Windows 10, Command Prompt and PowerShell. Most commands below need an administrator window: right-click Start, then select Terminal (Admin) or Windows PowerShell (Admin).

Laptop showing lines of commands, like running Windows Update from PowerShell

Open Windows Update from CMD or PowerShell

The quickest command opens the Windows Update page in Settings. It works in both Command Prompt and PowerShell and doesn’t need admin rights:

start ms-settings:windowsupdate

Microsoft documents a set of these ms-settings: links, so you can jump straight to the page you need:

CommandWhat it opens
start ms-settings:windowsupdateThe main Windows Update page
start ms-settings:windowsupdate-actionWindows Update, and starts checking for updates
start ms-settings:windowsupdate-historyUpdate history
start ms-settings:windowsupdate-optionalupdatesOptional updates, including drivers
start ms-settings:windowsupdate-optionsAdvanced options
start ms-settings:windowsupdate-restartoptionsRestart options
start ms-settings:windowsupdate-activehoursActive hours

These still open a window, so they’re handy for shortcuts and scripts you run yourself. To install updates with no window at all, use PowerShell below.

Check and install updates with PowerShell

Windows doesn’t include a built-in cmdlet that installs Windows updates. The most widely used option is PSWindowsUpdate, a free module by Michal Gajda published on the PowerShell Gallery. It’s third-party, not made by Microsoft, but it uses Windows’ own update service.

1. Install the module (once) in an administrator PowerShell window:

Install-Module -Name PSWindowsUpdate

If PowerShell asks to install the NuGet provider or says the repository is untrusted, type Y (or A) and press Enter. If it then says running scripts is disabled, allow it for the current window only:

Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned

2. List the updates available for your PC:

Get-WindowsUpdate

3. Install them all:

Install-WindowsUpdate -AcceptAll

Useful extras:

  • Install-WindowsUpdate -AcceptAll -AutoReboot restarts the PC automatically if an update needs it. Save your work first.
  • Install-WindowsUpdate -KBArticleID KB1234567 installs one specific update (replace KB1234567 with the update you want).
  • Install-WindowsUpdate -MicrosoftUpdate -AcceptAll also includes updates for other Microsoft products, such as Office installed from an MSI.
  • Get-WUHistory shows the update history, including failed installs.

Update downloads can take a while, so leave the window open until the command finishes.

See which updates are installed

PowerShell has a built-in cmdlet that lists installed Windows updates (hotfixes) with their KB numbers and install dates:

Get-HotFix | Sort-Object InstalledOn -Descending

To check for one update, add its number: Get-HotFix -Id KB1234567. Older guides use wmic qfe list, but WMIC is deprecated and missing from newer Windows 11 builds, so Get-HotFix is the safer choice.

Install an update package with wusa

Installer text scrolling on a dark screen while an update package installs

If you downloaded an update as an .msu file (for example from the Microsoft Update Catalog), Windows can install it with the built-in Windows Update Standalone Installer, wusa.exe:

wusa.exe C:\Downloads\update.msu /quiet /norestart
  • /quiet installs without prompts.
  • /norestart stops Windows from restarting by itself. Restart later to finish the install.
  • /warnrestart or /forcerestart warn the user or force a restart when the install needs one.

Replace the path with where your file actually is. If the file name has spaces, put the whole path in quotes. When an update says it isn’t applicable to your computer, it’s usually already installed, for a different Windows version, or for a different architecture (x64 versus ARM64).

Uninstall an update from the command line

If a recent update causes problems, wusa can also remove it by its KB number:

wusa.exe /uninstall /kb:1234567

Replace 1234567 with the update’s number, typed after /kb: without the letters “KB”. Add /quiet /norestart to skip the prompts. Some updates, such as servicing stack updates, can’t be removed this way. Security updates fix real holes, so only remove one as a temporary measure and reinstall it once a fix is out.

If an update leaves Windows unable to start properly, see how to fix a black screen in Windows; it covers getting into the recovery tools.

Update your apps with winget

Windows Update doesn’t update most desktop apps. For those, Windows 11 and recent Windows 10 include winget, Microsoft’s Windows Package Manager. In Command Prompt or PowerShell:

winget upgrade

This lists every installed app that winget knows a newer version of. To update all of them at once:

winget upgrade --all
  • winget upgrade --all --include-unknown also tries apps whose installed version winget can’t detect.
  • winget upgrade --all --silent --accept-package-agreements --accept-source-agreements runs with no prompts, which is useful in a script.
  • winget upgrade --id Mozilla.Firefox updates just one app (use the ID shown in the list).

Some apps have their own updater running in the background. If you’d rather control those yourself, see how to disable the Adobe updater as an example.

Laptop screen with code, used to update installed apps with winget

What about UsoClient and wuauclt?

Many older guides recommend these. Here’s where they stand:

  • wuauclt /detectnow and wuauclt /updatenow were the Windows 7 era commands. On Windows 10 and 11 they generally do nothing.
  • UsoClient StartScan (and StartInteractiveScan, StartDownload, StartInstall) replaced them, but Microsoft doesn’t document UsoClient, it shows no output, and its behavior has changed between versions. It may work on your PC, but don’t rely on it.

For a check you can see, use start ms-settings:windowsupdate-action; for a scripted install, use PSWindowsUpdate.

Reset Windows Update from the command line

If updates keep failing or get stuck downloading, resetting the update components clears the download cache. In an administrator Command Prompt, run these lines one at a time:

net stop wuauserv
net stop cryptsvc
net stop bits
net stop msiserver
ren C:\Windows\SoftwareDistribution SoftwareDistribution.old
ren C:\Windows\System32\catroot2 catroot2.old
net start wuauserv
net start cryptsvc
net start bits
net start msiserver

This renames the folders instead of deleting them, so nothing is lost. Windows creates fresh ones, and your update history page may look empty afterwards; that’s normal. If a service says it’s already stopped or the rename is denied, run net stop for that service again and retry the rename.

If PSWindowsUpdate is installed, Reset-WUComponents does a similar reset in one command. If updates still fail, repair Windows system files with SFC and DISM, since damaged system files are the next most common cause.

Official sources: for more detail, see Microsoft’s own documentation:

Frequently asked questions

Is there a built-in command to install Windows updates?

Not an officially documented one. start ms-settings:windowsupdate-action starts a check in the Settings app, and wusa.exe installs update files you’ve downloaded. For full command-line installs, most people use the PSWindowsUpdate module.

Is PSWindowsUpdate safe?

It’s a long-standing, widely used module on the official PowerShell Gallery, and it installs updates through Windows’ own update service. It’s still third-party software, so install it only from the PowerShell Gallery with Install-Module.

Does winget update Windows itself?

No. winget updates apps. Windows updates come through Windows Update, PSWindowsUpdate or wusa.

Do I need to run the commands as administrator?

Opening the Settings pages doesn’t. Installing or removing updates, installing PSWindowsUpdate and resetting the update components do. winget can run in a normal window but may ask for permission for some apps.

How we write our guides: read our editorial policy.

Comments

Leave a Reply

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