Can I get more information on what Windows Update is doing?

81

42

It often happens that I have to watch this screen for minutes:

enter image description here

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).

Der Hochstapler

Posted 2012-08-16T14:26:54.320

Reputation: 77 228

This might apply when *Get Windows 10* hijacks the update process. See How to install security updates after “Upgrade to Windows 10” hijacks Windows Update?

– jww – 2015-10-16T23:36:18.880

Answers

55

In Windows 10, you can use the PSWindowsUpdate PowerShell module.

> Install-Module PSWindowsUpdate
> Get-WindowsUpdate
> Install-WindowsUpdate

enter image description here

kizzx2

Posted 2012-08-16T14:26:54.320

Reputation: 889

2Works in Windows 7 too. :) – Charles Burge – 2017-03-08T01:38:53.883

17Win10 restricted due to a script policy. Start ps-console as admin Powershell.exe -ExecutionPolicy Unrestricted then run given commands. Probably need to run Import-Module PSWindowsUpdate before Get-WindowsUpdate. This policy applies to this PS session only. – Whome – 2017-06-18T18:42:17.707

I found the more reasonably restrictive Set-ExecutionPolicy -ExecutionPolicy RemoteSigned which is also persistent (going into the Local Poilcy object) https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-6&viewFallbackFrom=powershell-Microsoft.PowerShell.Core

– BaseZen – 2018-03-28T03:33:54.783

This is weird. On Win8.1 I get: Install-Module : The term 'Install-Module' is not recognized... and Get-WindowsUpdate : The term 'Get-WUList' is not recognized.... – not2qubit – 2018-11-18T18:19:04.940

Didn't work in old PS 5+ but works now in PWSH 6.1.1. – not2qubit – 2019-01-28T09:16:49.663

70

You can invoke Windows Update from command line using wuauclt.exe utility located in %windir%\system32\ folder.

To check for updates,

wuauclt.exe /detectnow

To check and update,

wuauclt.exe /detectnow /updatenow

This 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.exe

This 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.

ePandit

Posted 2012-08-16T14:26:54.320

Reputation: 810

9On Windows 7, wuauclt.exe doesn't seem to print any output to cmd. – wjandrea – 2017-02-14T19:04:20.487

Same on W8.1...no output – not2qubit – 2018-11-18T18:22:25.933

Does this trigger the 'opt-in' to the beta program on Windows 10, in the same way that manually checking for updates does? (https://www.digitaltrends.com/computing/windows10-check-for-updates/)

– metamorphosis – 2019-04-03T23:31:50.197

34

I 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

enter image description here

Update Installation

enter image description here

Der Hochstapler

Posted 2012-08-16T14:26:54.320

Reputation: 77 228

Great! Just need to update script to disable prompts, or add command line switches. – MarcusUA – 2017-05-17T12:26:16.500

How to tell in 2018 (Windows 10 home) install updates but never in 8AM till 6PM? – YumYumYum – 2018-06-05T12:25:14.153

3

Another option would be WSUS Offline.

– Der Hochstapler – 2013-03-18T22:07:23.980

11

You 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: https://support.microsoft.com/en-us/kb/262841

wusa.exe /uninstall /kb:123456 /quiet /norestart
wusa.exe Windows6.1-KB123456-x86.msu /quiet /norestart

This 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"

bgmCoder

Posted 2012-08-16T14:26:54.320

Reputation: 1 771

2Its really sad that I am here looking at this answer because malware known as *Update to Windows 10* has hijcaked the update process, and I can't install security updates. – jww – 2015-10-16T23:38:45.640

There are a number of reasons why Windows Updates might quit working, and a number of solutions, I would be happy to answer, but this is not the right topic... Just suffice to say that in the end, I wanted offline updates and ended up doing this: http://forums.mydigitallife.info/threads/45005-Simplix-Pack-to-update-Live-Win7-System-Integrate-hotfixes-into-Win7-distribution which works quite well!

– bgmCoder – 2015-10-19T14:14:30.360

9

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

smihi19

Posted 2012-08-16T14:26:54.320

Reputation: 91

But its not FREE????? – YumYumYum – 2018-06-05T12:27:27.993

5

Windows 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

Marcus Zheng

Posted 2012-08-16T14:26:54.320

Reputation: 61

2

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.

Benjamin Ziepert

Posted 2012-08-16T14:26:54.320

Reputation: 131

Does this trigger the 'opt-in' to the beta program on Windows 10, in the same way that manually checking for updates does? (digitaltrends.com/computing/windows10-check-for-updates) – metamorphosis – 2019-04-03T23:33:31.443

0

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:
https://docs.microsoft.com/en-us/windows/desktop/api/wuapi/nn-wuapi-iautomaticupdates

If you don't want to use PowerShell you can run

C:\Windows\System32\UsoClient.exe StartScan

directly from the command line.

oleschri

Posted 2012-08-16T14:26:54.320

Reputation: 1 075