CMD Windows Update Command: How to Update via Command Prompt
In this article
To update Windows using the command line, the most reliable method is using the Windows Update PowerShell module or the USO Client tool. While the traditional Command Prompt (CMD) does not have a single, native "update" command like Linux does, you can trigger the update process by running usoclient StartInteractiveScan in an elevated prompt, or by using PowerShell's Install-Module PSWindowsUpdate for full control. This allows you to bypass the graphical user interface (GUI) if it is frozen, unresponsive, or if you are managing a remote machine.
What You'll Need
- A computer running Windows 10 or Windows 11.
- Administrator privileges (you must be logged in as an admin or have the password).
- A stable internet connection to download the update packages.
- Access to the Command Prompt or PowerShell.
Step-by-Step
Because Windows handles updates through a complex set of services, there are two primary ways to do this. The first is a quick trigger via CMD, and the second is a comprehensive management approach via PowerShell. Labels and menu options may differ slightly depending on your specific Windows version or region.
Method 1: Using the USO Client (Quick Trigger)
- Press the Windows Key on your keyboard.
- Type cmd into the search bar.
- Right-click on Command Prompt in the search results and select Run as administrator. This is critical; the command will fail without elevated permissions.
- In the black window, type the following command exactly:
usoclient StartInteractiveScan - Press Enter.
- Wait a few moments. You will not see a progress bar inside the Command Prompt window. Instead, Windows will launch the Windows Update settings page in the background and begin scanning for updates automatically.
Method 2: Using PowerShell for Full Control (Advanced)
If you want to see exactly what is happening, including a list of available updates and the ability to install them without leaving the console, use the PSWindowsUpdate module.
- Press the Windows Key.
- Type PowerShell.
- Right-click Windows PowerShell and select Run as administrator.
- First, you must install the update module. Type the following command and press Enter:
Install-Module PSWindowsUpdate - The system will ask if you trust the repository. Type Y or A (for Yes to All) and press Enter.
- Once the module is installed, you need to import it into your current session. Type:
Import-Module PSWindowsUpdateand press Enter. - To check for available updates, type:
Get-WindowsUpdateand press Enter. This will generate a list of all pending updates, their KB numbers, and their descriptions. - To install all available updates and automatically restart the computer if required, type:
Install-WindowsUpdate -AcceptAll -AutoRebootand press Enter. - The console will now display the real-time progress of each download and installation. Do not close the window until the process is complete.
Common Mistakes
The most frequent error users encounter is failing to run the console as an administrator. If you simply open CMD or PowerShell by clicking the icon, you will receive an "Access Denied" or "Permission Denied" error. Always ensure the window title says "Administrator: Command Prompt" or "Administrator: Windows PowerShell".
Another common mistake is expecting the usoclient command to show a progress bar within the CMD window. The USO Client is a trigger, not a full interface. It tells the system's update agent to start working, but it does not report the status back to the command line. If you need to see the progress, you must open Settings > Update & Security > Windows Update.
Users also often forget to accept the NuGet provider prompt when installing the PowerShell module. When you run Install-Module, Windows may ask to install the NuGet provider first. If you ignore this or type "N", the module installation will fail, and subsequent update commands will not be recognized.
Tips
If you are managing a computer that is behaving erratically, it is a good idea to clear the Windows Update cache before running these commands. You can do this by stopping the update services, deleting the contents of the C:\Windows\SoftwareDistribution folder, and then restarting the services. This forces Windows to re-scan the servers from scratch, which often fixes "stuck" updates.
For those who frequently use the command line, you can create a simple .bat file. Open Notepad, paste usoclient StartInteractiveScan, and save the file as "Update.bat". Whenever you want to check for updates, right-click that file and select "Run as administrator".
When using the PowerShell method, if you only want to install a specific update from the list provided by Get-WindowsUpdate, you can use the -KBArticleID flag. For example, Install-WindowsUpdate -KBArticleID KB1234567 allows you to target one specific patch without updating the entire system.
Troubleshooting
If the commands do not seem to trigger any action, start with the simplest check: verify your internet connection. If the network is unstable, the USO client will fail silently. Restart your router and try the command again.
If you receive an error stating that the "module was not found" in PowerShell, ensure you are connected to the internet and that you ran the Install-Module command successfully. If you are behind a corporate firewall, you may need to change the security protocol for the session by running [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 before attempting to install the module.
If the update process starts but gets stuck at a certain percentage, try restarting the Windows Update service. In an administrator CMD window, type net stop wuauserv, press Enter, and then type net start wuauserv and press Enter. This refreshes the background service responsible for managing the downloads.
In extreme cases where the command line fails and the GUI is unresponsive, check if there is a pending restart. Sometimes Windows will block new update requests until a previous installation is finalized via a reboot. Restart your PC and attempt the usoclient command once more.
Frequently Asked Questions
Can I update Windows via CMD without an internet connection?
No. The CMD and PowerShell commands trigger the system to contact Microsoft's servers to find and download patches. You must have an active internet connection for these commands to function.
Is the USO Client command safe for all Windows versions?
The usoclient tool is designed for Windows 10 and Windows 11. It may not work on older versions like Windows 7 or 8, which used different update agents (such as wuauclt).
Does using the command line make updates install faster?
The installation speed is the same because the command line uses the same underlying system services as the Settings menu. However, it can be "faster" for the user because it bypasses the need to navigate through multiple menu screens.
Will these commands delete my personal files?
No. Windows Update commands only affect system files, drivers, and OS patches. They do not touch your personal documents, photos, or applications. However, it is always a best practice to have a backup of your data before performing major OS updates.
What is the difference between usoclient and PSWindowsUpdate?
The USO Client is a built-in trigger that opens the GUI and starts the scan. PSWindowsUpdate is a third-party community module that provides a professional-grade interface within the console, allowing you to see, select, and install updates without ever leaving the window.