If you are wondering how to run Windows Update via command line then this post is for you. I will guide how you can run Windows Update using the command line on your system and install the latest updates. Although you can also use Windows 10 inbuilt option for the same. So, let’s start!
There are two methods to search, download and install updates in Windows 10
Run Windows Update Using Command Prompt
The easiest way to execute the Windows Update is to use the Command-Line. You will need Administrator access on the command prompt. Here are the steps:
1) Click on the Windows logo and type the command prompt.
2) In the user menu that pops up, select Command Prompt and right-click on it to choose “Run as administrator”
3) Click on “Yes” if the “User Account Control” dialogue box pops up. If not, follow the next step.
4) Once the command prompt window opens, type the following command to check if new updates are available and press the Enter key:
UsoClient StartScan
5) Now, for downloading new updates, type below text and press Enter button:
UsoClient StartDownload
6) Next, for installing those downloaded updates, type below command and hit Enter key
UsoClient StartInstall
7) Once the Windows update installed, you have to restart your system to save the new changes to the system. To do so, type given text and hit Enter again
UsoClient RestartDevice
Bonus Tip:
However if you want to check, download and install the updates altogether, then the command for that is
UsoClient SacnInstallWait
Now you can type exit to close the command prompt window.
Please note that while executing the above command line, you might not able to see any Windows update.
If you are receiving Windows update error code 0xc8000222 then you may read this to fix it.
Using PowerShell 2.0 or above
This is another method but very much similar to the command prompt to run the Windows Update on your system:
1) Go to the Start button (Windows logo) at the bottom left corner of your screen and right-click on it.
2) In the user menu that pops up, select Windows Powershell (Admin)
3) When the PowerShell window opens you will have to first install the module of Windows Update onto PowerShell for the commands to work. For this, type below command hit Enter key:
Install-Module PSWindowsUpdate
4) If you get the message “Do you want Powershell to install and import the NuGet provider now?”, type Y and press the Enter key.
4) If you are prompted again with a message “Are you sure you want to install the module from PSGallery”, type Y and press the Enter key.
5) To check for and simultaneously download any Windows Update, type
Get-WindowsUpdate
6) To install those downloaded updates, type
Install-WindowsUpdate
7) Type Y and hit Enter when prompted with the message “Confirm Are you sure you want to perform this action?”
Close the PowerShell window by clicking on the cross sign at the top right corner of the window.
So, this was the two ways to update the Windows Update using the command line. I hope, you find it useful.