Skip to content
WindowsAdvanced

How to Run Windows Update from Command Line, CMD & PowerShell – Complete Windows 10/11 and Windows Server Guide

Windows Update normally operates automatically through the Windows Settings interface. However, system administrators, IT support engineers, advanced users, ...

BI
Bison Technical Team Enterprise IT specialists
Updated 01 Jan 2025 16 min read 1,737 total views
Structured technical guidanceSafety notes included where requiredSources listed below

Windows Update normally operates automatically through the Windows Settings interface. However, system administrators, IT support engineers, advanced users, and server administrators frequently need to check, download, install, troubleshoot, or automate Windows Updates from the command line.

Command-line Windows Update management is particularly useful when:

Advertisement
  • Windows Settings is not opening.
  • The Windows Update graphical interface is malfunctioning.
  • You are working on Windows Server.
  • A computer is being managed remotely.
  • Updates need to be automated.
  • Multiple computers require standardized maintenance.
  • You need to install updates through PowerShell.
  • Windows Update components need troubleshooting.
  • You want to create maintenance scripts.
  • You are administering systems through RDP.
  • Updates must be installed during scheduled maintenance windows.

This guide explains the major Windows Update command-line methods available for modern Windows environments, including Windows 10, Windows 11 and Windows Server.


1. Understanding Windows Update Command-Line Methods

Several different mechanisms are commonly described as "Windows Update command-line commands."

They should not be confused with each other.

Method Purpose Recommended Usage
Windows Settings Normal interactive updating Regular users
wuauclt.exe Legacy Windows Update Agent interface Older Windows environments
UsoClient.exe Update Session Orchestrator commands Modern Windows
PowerShell Administration and automation Administrators
PSWindowsUpdate Advanced PowerShell update management IT administrators
DISM Windows image/component servicing Repair and package management
Windows Update services Troubleshooting update components Advanced troubleshooting
Microsoft Update Catalog Manual KB installation Offline/manual updating

Modern administrators should generally prefer PowerShell and supported Windows management mechanisms rather than building new automation around old wuauclt commands.


2. Always Run CMD or PowerShell as Administrator

Most Windows Update administration requires elevated privileges.

Open Command Prompt as Administrator

Press:

Windows + S

Search for:

cmd

Right-click Command Prompt and select:

Run as administrator

You can also press:

Windows + R

Type:

cmd

Then press:

Ctrl + Shift + Enter


3. Open PowerShell as Administrator

Search for:

PowerShell

Right-click Windows PowerShell and select:

Run as administrator

On newer Windows systems you may also use Windows Terminal (Admin).

Administrative privileges are especially important when installing modules, modifying services, repairing Windows components, or installing updates.


4. Legacy Windows Update Commands – WUAUCLT

Older Windows versions used:

wuauclt.exe

which stands for Windows Update AutoUpdate Client.

Common commands historically included:

wuauclt /detectnow

and:

wuauclt /updatenow

Another historically used command is:

wuauclt /reportnow

What these commands were intended to do

/detectnow

Requested Windows Update Agent to initiate update detection.

/updatenow

Requested update processing.

/reportnow

Requested the client to report update status.


5. Important Warning About WUAUCLT

wuauclt is primarily associated with older Windows Update implementations.

Although the executable may still exist on newer Windows versions for compatibility reasons, administrators should not assume that old wuauclt switches provide reliable or immediate Windows Update control on modern Windows 10/11 systems.

Therefore, commands such as:

wuauclt /detectnow

should be treated as legacy commands, rather than the preferred Windows 11 update-management method.

For new administrative scripts, PowerShell-based management is usually more practical.


6. UsoClient – Windows Update Session Orchestrator

Modern Windows versions include:

UsoClient.exe

UsoClient is associated with the Windows Update Update Session Orchestrator.

You may encounter commands such as:

UsoClient StartScan
UsoClient StartDownload
UsoClient StartInstall
UsoClient ScanInstallWait
UsoClient RestartDevice

These commands have been widely used by administrators for triggering parts of the Windows Update process.

However, an important limitation must be understood:

UsoClient is an internal Windows component and should not be treated as a fully documented administrative command-line API.

Its behavior can differ between Windows builds, and commands that work on one version may not provide identical visible results on another.

Therefore, it can be useful for troubleshooting or administrative testing, but PowerShell provides better visibility when repeatable update management is required.


7. Check Windows Update Services

Windows Update depends on several Windows services.

To check the primary Windows Update service from CMD:

sc query wuauserv

From PowerShell:

Get-Service wuauserv

You can also check several update-related services:

Get-Service wuauserv,bits,cryptsvc

Important services include:

Windows Update

Service name:

wuauserv

Background Intelligent Transfer Service

Service name:

BITS

Cryptographic Services

Service name:

cryptsvc

These services participate in different portions of Windows update downloading, validation and servicing.


8. Start Windows Update Service

From an elevated Command Prompt:

net start wuauserv

Or PowerShell:

Start-Service wuauserv

9. Stop Windows Update Service

For troubleshooting purposes:

net stop wuauserv

PowerShell equivalent:

Stop-Service wuauserv

Do not permanently disable Windows Update merely because an update is temporarily failing.

Security updates are an important part of protecting Windows computers.


10. Check BITS Service

Use:

sc query bits

or:

Get-Service BITS

To start it:

Start-Service BITS

11. Best PowerShell Method – PSWindowsUpdate

One of the most useful PowerShell solutions for administrators is:

PSWindowsUpdate

It provides cmdlets for searching, downloading, installing and reviewing Windows Updates.

It is especially useful for:

  • Windows administrators
  • IT support companies
  • Windows Server administrators
  • Remote maintenance
  • Automated update deployment
  • Server maintenance scripts
  • Multiple-machine management

12. Check PowerShell Version

Before installing the module, check PowerShell:

$PSVersionTable

Or:

$PSVersionTable.PSVersion

Modern versions of PSWindowsUpdate require Windows PowerShell 5.1 or later.


13. Install PSWindowsUpdate

Open PowerShell as Administrator.

Run:

Install-Module -Name PSWindowsUpdate

If prompted to install the NuGet provider, approve the request.

If prompted regarding an untrusted repository, carefully verify that PowerShell Gallery is the intended repository before continuing.

You may also encounter:

Install-Module PSWindowsUpdate -Force

The -Force option can suppress some prompts or replace an existing module version, so administrators should understand why it is being used rather than automatically adding it to every script.


14. Import PSWindowsUpdate

After installation:

Import-Module PSWindowsUpdate

To confirm that the module is available:

Get-Module PSWindowsUpdate -ListAvailable

15. View PSWindowsUpdate Commands

Run:

Get-Command -Module PSWindowsUpdate

This displays available Windows Update management commands.

Depending on the installed module version, these can include commands for:

  • Searching for updates
  • Installing updates
  • Viewing update history
  • Checking reboot status
  • Managing update services
  • Resetting Windows Update components

16. Check Available Windows Updates

Run:

Get-WindowsUpdate

This scans for applicable updates and displays available results.

This is much more useful for administrators than simply issuing a command that silently requests Windows to scan.


17. Install Available Windows Updates

A commonly used command is:

Install-WindowsUpdate -AcceptAll

This instructs the module to install applicable updates and accept them automatically.


18. Install Updates and Automatically Restart

Use:

Install-WindowsUpdate -AcceptAll -AutoReboot

Important

Do not use -AutoReboot casually on:

  • Production servers
  • RDS servers
  • Database servers
  • Accounting servers
  • Hyper-V hosts
  • File servers
  • Domain controllers
  • Systems with active users

An automatic restart could disconnect users or interrupt applications.

For business servers, planned maintenance is preferable.


19. Install Updates Without Automatically Restarting

For production environments, you may prefer:

Install-WindowsUpdate -AcceptAll -IgnoreReboot

You can then restart the computer manually during an approved maintenance window.


20. Check Whether Windows Requires Restart

With PSWindowsUpdate installed:

Get-WURebootStatus

This can help determine whether update processing has created a pending reboot condition.


21. View Windows Update History

Run:

Get-WUHistory

This is useful for determining:

  • Which updates were installed
  • Installation dates
  • Update results
  • Recent update activity

For additional filtering you can use normal PowerShell techniques, for example:

Get-WUHistory | Select-Object -First 20

22. Search for a Particular KB Update

Suppose you need to investigate a specific Microsoft Knowledge Base update.

You can first retrieve updates and filter the results.

For example:

Get-WindowsUpdate | Where-Object {$_.KB -match "KB"}

Exact filtering capabilities can depend on the module version and returned update properties.

Always review the detected updates before deploying them to critical systems.


23. Include Microsoft Update

Windows Update and Microsoft Update are related but not identical concepts.

Microsoft Update can provide updates for additional Microsoft products.

PSWindowsUpdate includes mechanisms for managing Windows Update service sources.

Administrators should verify which update source a system is configured to use, especially in managed enterprise environments.


24. Windows Update in WSUS Environments

Business computers may obtain updates through:

Windows Server Update Services (WSUS)

instead of directly from Microsoft's public update infrastructure.

In these environments, command-line scans do not necessarily bypass organizational policy.

The computer may still follow:

  • Group Policy
  • WSUS approval rules
  • Windows Update for Business policy
  • Organizational update rings
  • Microsoft Intune policies

This is important when troubleshooting a system that reports:

No updates available

even though you believe Microsoft has released a newer update.


25. Check Windows Update Policies

Generate a Group Policy report:

gpresult /h C:\GPReport.html

Then open:

C:\GPReport.html

Review Windows Update-related policies.

This is particularly useful on domain-joined systems.


26. Check Windows Version Before Updating

From CMD:

winver

or:

systeminfo

From PowerShell:

Get-ComputerInfo

You can obtain concise OS information with:

Get-ComputerInfo | Select-Object WindowsProductName,WindowsVersion,OsBuildNumber

This helps establish the system's current state before troubleshooting updates.


27. Check Installed Hotfixes

A commonly used PowerShell command is:

Get-HotFix

For recent entries:

Get-HotFix | Sort-Object InstalledOn -Descending

Remember that Get-HotFix should not necessarily be interpreted as a complete inventory of every component update installed through every modern servicing mechanism.

For Windows Update-specific history, use Windows Update history and appropriate update-management tools as well.


28. Restart Windows from Command Line

Immediate restart:

shutdown /r /t 0

Restart after 60 seconds:

shutdown /r /t 60

Cancel a scheduled shutdown/restart:

shutdown /a

For servers, always verify active users before restarting.


29. Check Logged-In Users Before Restarting a Server

On Windows Server:

query user

or:

quser

This is particularly important on Remote Desktop Services servers.

Never automatically restart a production RDS server without checking active sessions unless your organization's maintenance process explicitly permits it.


30. Windows Update Troubleshooting from CMD

If Windows Update is malfunctioning, first verify the service:

sc query wuauserv

Check BITS:

sc query bits

Then inspect Windows logs and Windows Update history before performing aggressive resets.


31. Repair Windows Component Store with DISM

Windows Update failures can sometimes be related to Windows component-store corruption.

Run:

DISM /Online /Cleanup-Image /ScanHealth

Then:

DISM /Online /Cleanup-Image /RestoreHealth

After DISM completes successfully, run:

sfc /scannow

Restart the computer if required and retry Windows Update.


32. What DISM Does

DISM stands for:

Deployment Image Servicing and Management

DISM /RestoreHealth checks and repairs corruption in the Windows component store used by Windows servicing.

It is therefore different from simply triggering a Windows Update scan.


33. What SFC Does

SFC stands for:

System File Checker

Run:

sfc /scannow

SFC verifies protected Windows system files and attempts to replace corrupted versions.

A useful repair sequence for many servicing problems is:

DISM /Online /Cleanup-Image /RestoreHealth
sfc /scannow

Then restart Windows and test Windows Update again.


34. Reset Windows Update Components – Advanced Troubleshooting

When Windows Update is severely corrupted, administrators sometimes reset the update cache.

A typical troubleshooting procedure begins by stopping relevant services:

net stop wuauserv
net stop bits
net stop cryptsvc

Then the update cache folders may be renamed rather than immediately deleted:

ren C:\Windows\SoftwareDistribution SoftwareDistribution.old
ren C:\Windows\System32\catroot2 catroot2.old

Restart services:

net start cryptsvc
net start bits
net start wuauserv

Then restart Windows and check for updates again.

Why rename instead of immediately deleting?

Renaming provides a safer troubleshooting approach because the original folders remain temporarily available if further investigation is required.

Windows can recreate the required update-cache structures.


35. Important Warning About Resetting SoftwareDistribution

Do not use Windows Update reset procedures as routine maintenance.

They should normally be used when troubleshooting specific Windows Update problems such as:

  • Repeated download failures
  • Corrupted update cache
  • Updates stuck at a percentage
  • Persistent update errors
  • Windows Update failing after other repair steps

Resetting Windows Update components can remove locally stored update information and change what is immediately visible in parts of the update interface.


36. Check Windows Update Log

Modern Windows versions can generate a readable Windows Update log using PowerShell:

Get-WindowsUpdateLog

This creates a readable WindowsUpdate.log from Windows Update tracing information.

The log can help troubleshoot:

  • Update detection failures
  • Download errors
  • Installation errors
  • Update service problems
  • Policy-related behavior

37. Check Event Viewer

For detailed Windows Update troubleshooting, use:

Event Viewer

Navigate to:

Applications and Services Logs
   Microsoft
      Windows
         WindowsUpdateClient
            Operational

Events here can provide information about:

  • Successful update installation
  • Failed updates
  • Detection events
  • Download problems
  • Installation problems

38. Manually Install a Downloaded MSU Update

Microsoft standalone update packages commonly use the .msu extension.

A downloaded package can traditionally be installed using Windows Update Standalone Installer:

wusa.exe C:\Updates\update.msu

Silent installation examples may use supported installer switches where applicable.

However, administrators should verify the correct switches and restart requirements for the specific update package before deploying it broadly.


39. Installing CAB Packages

Some Windows packages are distributed as .cab files.

DISM can add compatible packages:

DISM /Online /Add-Package /PackagePath:"C:\Updates\package.cab"

This is an advanced servicing operation.

Always confirm that the package:

  • Matches the operating system
  • Matches the architecture
  • Applies to the installed Windows build
  • Comes from a trusted Microsoft source

40. Windows Update Error Troubleshooting Workflow

When Windows Update fails, use the following order rather than immediately resetting everything.

Step 1 – Check Internet Connectivity

ping 8.8.8.8

Then verify DNS resolution:

nslookup microsoft.com

Step 2 – Check Windows Update Service

sc query wuauserv

Step 3 – Check BITS

sc query bits

Step 4 – Check Windows Version

winver

Step 5 – Run DISM

DISM /Online /Cleanup-Image /RestoreHealth

Step 6 – Run SFC

sfc /scannow

Step 7 – Restart Windows

shutdown /r /t 0

Step 8 – Scan for Updates Again

Use Windows Settings or an appropriate administrative update-management method.

Step 9 – Review Logs

Use Windows Update history, Event Viewer, and:

Get-WindowsUpdateLog

Step 10 – Reset Windows Update Components

Only if previous troubleshooting does not resolve the problem.


41. Windows 10 vs Windows 11 vs Windows Server

The basic Windows servicing architecture is related across Windows editions, but update behavior can differ.

Windows 10

Supports normal Windows Update, PowerShell administration, DISM, Windows Update Agent components and enterprise management.

Windows 11

Uses modern Windows Update orchestration and enterprise update-management policies.

Windows Server

Windows Update administration often requires additional planning because servers may host:

  • Active RDP sessions
  • Databases
  • Accounting software
  • File shares
  • Domain services
  • Business applications
  • Virtual machines

Server restarts therefore require much greater operational control.


42. Recommended Method for Normal Desktop PCs

For normal Windows 10/11 computers:

  1. Use Settings → Windows Update first.
  2. Use command-line tools when automation or troubleshooting is necessary.
  3. Use DISM/SFC if servicing corruption is suspected.
  4. Use PSWindowsUpdate when detailed PowerShell-based administration is required.

43. Recommended Method for IT Administrators

For administrators managing multiple computers:

  • Use PowerShell.
  • Use organizational update policies.
  • Consider WSUS, Intune or Windows Update for Business where appropriate.
  • Test updates before broad production deployment.
  • Maintain backups.
  • Document installed KB updates.
  • Control reboot timing.
  • Review failed-update logs.
  • Avoid unsupported scripting dependencies where possible.

44. Recommended Method for Windows Servers

Before updating a production server:

  1. Confirm a current backup.
  2. Check application health.
  3. Check free disk space.
  4. Check logged-in users.
  5. Review pending updates.
  6. Review known update compatibility concerns.
  7. Define a maintenance window.
  8. Install approved updates.
  9. Restart if required.
  10. Verify server services after reboot.
  11. Verify business applications.
  12. Confirm RDP/network access.
  13. Review Event Viewer for unexpected errors.

45. Useful Windows Update Command Reference

winver

Displays Windows version.

systeminfo

Displays detailed system information.

sc query wuauserv

Checks Windows Update service.

sc query bits

Checks BITS.

net start wuauserv

Starts Windows Update service.

net stop wuauserv

Stops Windows Update service.

shutdown /r /t 0

Immediately restarts Windows.

shutdown /a

Cancels a scheduled shutdown/restart.

DISM /Online /Cleanup-Image /RestoreHealth

Repairs the Windows component store.

sfc /scannow

Checks protected Windows system files.


46. Useful PowerShell Windows Update Commands

Check Windows Update service:

Get-Service wuauserv

Check several services:

Get-Service wuauserv,bits,cryptsvc

Check Windows version:

Get-ComputerInfo

Install PSWindowsUpdate:

Install-Module PSWindowsUpdate

Import module:

Import-Module PSWindowsUpdate

Check available updates:

Get-WindowsUpdate

Install updates:

Install-WindowsUpdate -AcceptAll

Install and automatically restart:

Install-WindowsUpdate -AcceptAll -AutoReboot

View update history:

Get-WUHistory

Check reboot status:

Get-WURebootStatus

Generate Windows Update log:

Get-WindowsUpdateLog

47. CMD vs PowerShell for Windows Update

Requirement CMD PowerShell
Check services Yes Yes
Start/stop services Yes Yes
Restart computer Yes Yes
Repair Windows Yes Yes
Detailed update listing Limited Excellent with appropriate module/API
Install multiple updates Limited Excellent
Update history Limited Excellent
Automation Basic Excellent
Filtering Limited Excellent
Remote administration Limited Excellent
Enterprise scripting Limited Excellent

For modern IT administration, PowerShell is generally the better choice.


48. Security Considerations

Windows Updates frequently contain fixes for vulnerabilities involving:

  • Privilege escalation
  • Remote code execution
  • Authentication
  • Networking
  • Microsoft Defender
  • Windows kernel
  • Browsers
  • Cryptographic components
  • Remote Desktop
  • Windows services

Therefore, permanently disabling Windows Update can increase security risk.

Organizations should instead use controlled update-management policies.


49. Should Windows Update Be Disabled on Servers?

Usually, the better strategy is not to permanently disable Windows Update but to control when updates are approved, installed and restarted.

Production servers require planned patch management.

A good server patching policy includes:

  • Backup verification
  • Update testing
  • Maintenance windows
  • Controlled reboot
  • Application verification
  • Rollback planning
  • Documentation

50. Frequently Asked Questions (FAQ)

Q1. Can Windows Update be run from Command Prompt?

Yes. CMD can control Windows Update-related services, run repair commands and invoke certain Windows components. However, detailed modern update management is generally better handled with PowerShell or enterprise management systems.

Q2. Does wuauclt /detectnow still work?

wuauclt is a legacy Windows Update mechanism. The executable may still exist, but administrators should not depend on legacy switches for modern Windows Update automation.

Q3. What replaced wuauclt?

Modern Windows uses newer Windows Update orchestration components. Administrators may encounter UsoClient, while PowerShell and enterprise management tools provide more useful management capabilities.

Q4. What does UsoClient StartScan do?

It requests the Windows Update orchestration system to begin an update scan. Its behavior is implementation-dependent and may vary between Windows releases.

Q5. What is PSWindowsUpdate?

PSWindowsUpdate is a PowerShell module providing commands for managing Windows Updates.

Q6. Is PSWindowsUpdate built into Windows?

No. It is an additional PowerShell module and must normally be installed separately.

Q7. How do I check for updates using PowerShell?

After installing and importing PSWindowsUpdate:

Get-WindowsUpdate

Q8. How do I install all available updates?

A commonly used PSWindowsUpdate command is:

Install-WindowsUpdate -AcceptAll

Review updates and organizational policy before automatically installing everything on production systems.

Q9. How can I automatically reboot after updates?

Install-WindowsUpdate -AcceptAll -AutoReboot

Do not use this option on production systems without an approved maintenance window.

Q10. How do I prevent automatic reboot?

Where supported by the installed PSWindowsUpdate version:

Install-WindowsUpdate -AcceptAll -IgnoreReboot

Q11. How do I see Windows Update history?

With PSWindowsUpdate:

Get-WUHistory

Q12. How can I check whether Windows requires rebooting?

With PSWindowsUpdate:

Get-WURebootStatus

Q13. How do I repair Windows Update corruption?

Start with:

DISM /Online /Cleanup-Image /RestoreHealth
sfc /scannow

Then restart Windows and retry Windows Update.

Q14. Should I delete the SoftwareDistribution folder?

Not as routine maintenance. Resetting the Windows Update cache should be reserved for troubleshooting specific update problems. Renaming the folder is often preferable during diagnosis.

Q15. What is the SoftwareDistribution folder?

It is part of Windows Update's local working and caching infrastructure.

Q16. What is BITS?

BITS stands for Background Intelligent Transfer Service. Windows and other Microsoft components use it for managed background file transfers.

Q17. Can I install Windows Updates remotely?

Yes, but the appropriate method depends on your environment. PowerShell remoting, management platforms, Intune, WSUS and other enterprise systems may be used.

Q18. Can Windows Server be updated with PowerShell?

Yes. PowerShell can be very useful for Windows Server update administration, but production maintenance and reboot planning are essential.

Q19. Does DISM install normal Windows Updates?

DISM /RestoreHealth is primarily a servicing and repair command. DISM can also add compatible packages manually, but it is not equivalent to pressing Check for updates.

Q20. What is the safest way to update a production server?

Back up the server, review updates, verify compatibility, schedule downtime, check active users, install approved patches, restart during the maintenance window, and verify all services and applications afterward.


Conclusion

Windows Update can be managed from CMD and PowerShell, but the correct method depends on the operating system and administrative requirement.

Older commands such as:

wuauclt /detectnow

are primarily legacy mechanisms and should not form the foundation of new Windows Update automation.

For modern administration, PowerShell provides substantially greater visibility and automation capability. The PSWindowsUpdate module can provide commands for discovering updates, installing them, checking update history and determining reboot requirements.

For Windows Server and business environments, updates should always be handled through a controlled patch-management process involving backups, maintenance windows, compatibility checks, controlled reboots and post-update verification.

 

#WindowsUpdate #Windows11 #Windows10 #WindowsServer #PowerShell #CMD #CommandPrompt #PSWindowsUpdate #WindowsUpdates #MicrosoftWindows #WindowsAdmin #SystemAdministrator #SysAdmin #ITSupport #ITAdministrator #WindowsTroubleshooting #WindowsSecurity #PatchManagement #WindowsPatching #ServerManagement #ServerAdministration #WindowsServer2019 #WindowsServer2022 #WindowsServer2025 #UsoClient #WUAUCLT #DISM #SFC #WindowsRepair #WindowsUpdateError #WindowsUpdateFix #WindowsUpdateService #WUAUSERV #BITS #SoftwareDistribution #WindowsUpdateCache #MicrosoftUpdate #SecurityUpdates #CumulativeUpdate #PowerShellCommands #PowerShellTips #WindowsCommands #ITInfrastructure #EnterpriseIT #RDS #WSUS #WindowsMaintenance #TechnicalSupport #ITKnowledgebase #WindowsGuide

YOUR FEEDBACK

Was this guide useful?

Your answer helps us keep BISONKB accurate and practical.

THE BISON BRIEF

Practical IT knowledge, once a week.

New troubleshooting guides, scripts and infrastructure notes. No noise.

By subscribing, you agree to our privacy policy. Unsubscribe at any time.