It often happens that I have to watch this screen for minutes:
I have no clue what's happening in the back. And I'm also not interested in watching the WindowsUpdate.log for changes.
I would love to know if there's a way that gives more feedback. Preferably something I can invoke from the command line (like apt-get).
8 Answers
In Windows 10, you can use the PSWindowsUpdate PowerShell module.
> Install-Module PSWindowsUpdate
> Get-WindowsUpdate
> Install-WindowsUpdate 5 You can invoke Windows Update from command line using wuauclt.exe utility located in %windir%\system32\ folder.
To check for updates,
wuauclt.exe /detectnowTo check and update,
wuauclt.exe /detectnow /updatenowThis will not work if you have set "Never check for updates" in Windows Update settings. Also probably automatic updates must be enabled for '/updatenow' switch to work (install updates).
In versions of Windows prior to Windows 10, you can also start the GUI for Windows Update by entering following command (located in %windir%\system32\ folder):
wuapp.exeThis only opens the update application and checks available updates, it does not install them. Also if you have set "Never check for updates" in Windows Update settings, this does not checks for updates too, you will have to click the "Check for updates" button.
3I found some great suggestions when looking into How to to Install Windows Updates on Windows Server 2008 R2 Core.
One suggestion I really liked, is the WUA_SearchDownloadInstall.vbs script.
Available Updates being listed
Update Installation
3You can use wusa.exe which is part of Windows 7.
I wanted to remove the Windows 10 Update icon from the taskbar, so I wrote this AutoHotkey script which invokes wusa.
wusa := "c:\windows\system32\wusa.exe"
runwait %wusa% /uninstall /kb:2952664 /norestart
runwait %wusa% /uninstall /kb:3021917 /norestart
runwait, %wusa% /uninstall /kb:3035583 /norestart
msgbox, okay, all done!`rDon't forget to -hide- the updates now.So you can use wusa.exe to manage Windows updates and install .msu files.
Here are the commandline parameters for wusa:
wusa.exe /uninstall /kb:123456 /quiet /norestart
wusa.exe Windows6.1-KB123456-x86.msu /quiet /norestartThis page has a collection of other ways to manage updates from the commandline.
This page explains how wusa.exe works.
To see what updates are installed (via commandline):
systeminfo | find ": KB" 2 I'm using WuInstall. It is a command line tool for managing Windows Updates. You have many great options like displaying the installation progress, to specify if you want a reboot and when, and logfiles are available for every process. Regards
1Windows 10, and Windows Server 2016 or above, use USOClient.exe to scan, download, and install updates.
- StartScan Used To Start Scan
- StartDownload Used to Start Download of Patches
- StartInstall Used to Install Downloaded Patches
- RefreshSettings Refresh Settings if any changes were made
- StartInteractiveScan May ask for user input and/or open dialogues to show progress or report errors
- RestartDevice Restart device to finish installation of updates
- ScanInstallWait Combined Scan Download Install
- ResumeUpdate Resume Update Installation On Boot
Command Line Equivalent of wuauclt in Windows 10 / Windows Server 2016
Based on the answer from kizzx2 I created two one liners for the command prompt.
Run the following code from an elevated command line.
Installation of the update module:
Powershell.exe -ExecutionPolicy Unrestricted -command "Install-Module PSWindowsUpdate -force"Performing update from command line:
Powershell.exe -ExecutionPolicy Unrestricted -command "Import-Module PSWindowsUpdate; Get-WindowsUpdate; Install-WindowsUpdate"Furthermore, you can add the options -AcceptAll and -AutoReboot to the Install-WindowsUpdate command.
The easiest and most reliable way I found is to call the COM object from PowerShell.
$autoUpdate = New-Object -ComObject Microsoft.Update.AutoUpdate
$autoUpdate.DetectNow()The other methods of the object seem to do nothing on Windows 10. See also:
If you don't want to use PowerShell you can run
C:\Windows\System32\UsoClient.exe StartScandirectly from the command line.