How to Run Windows Update from the Command Line (CMD or PowerShell)

Sometimes you may need to install Windows updates from the command line.
There can be various reasons for this (for example, if the graphical interface is not responding), but with these commands (provided you have the necessary rights) you can check for updates and then install them.

1 – Using the Command Prompt (CMD)

  • Launch the Command Prompt with administrative rights
  • Run the command `wuauclt /detectnow` to check for updates;
  • Run the command `wuauclt /updatenow` to install the updates detected/downloaded;
  • [optional] run the command `wuauclt /reportnow` to generate a report to send to the WSUS server (if available);

2 – Using PowerShell

  • Launch Windows PowerShell with administrative rights;
  • Run the command `Install-Module PSWindowsUpdate` to install the Windows Update module for PowerShell (only needed if you don’t already have this module);
  • Run the command `Get-WindowsUpdate` to check for updates;
  • Run the command `Install-WindowsUpdate` to start installing Windows updates.

Enjoy!

Leave a Comment

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

Scroll to Top