updates then shudown from command prompt

StrangeTech 21 Reputation points

I've seen this asked before, but no reasonable answer.

Is there a command that I can put in a batch file that:

  • Checks for updates,
  • Installs updates
  • Then shuts down. (I'll even take a restart at this point!)

I've tried: wuauclt /DetectNow /Updatenow
But it doesn't wait to install updates before moving on

Even if it can check for updates, install updates, THEN move onto the next line. But at the moment there doesn't seem to be any return that the update has done installing

I want to trigger the process, then move on to the next PC.
It doesn't seem like it should be that difficult!

What am I missing?

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
9,481 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Dave Patrick 416.4K Reputation points MVP

    Give these ones a try.

    --please don't forget to upvote and Accept as answer if the reply is helpful--

  2. S.Sengupta 13,366 Reputation points MVP

    Download and install the Windows Update PowerShell Module. Then, you can run the command Get-WUInstall -AcceptAll -AutoReboot (there are other switches and arguments to control what updates get installed).

    0 comments No comments

  3. Limitless Technology 43,231 Reputation points


    This is possible via PowerShell. If you're interested in trying this, please see the following commands:

    This will install the Windows Update module in PowerShell:
    Install-Module PSWindowsUpdate

    This command will check for updates:

    Adds Microsoft update for other MS Apps other than Windows (Optional):
    Add-WUServiceManager -MicrosoftUpdate

    To install updates and then reboot please use the following command:
    Install-WindowsUpdate -MicrosoftUpdate -AcceptAll -AutoReboot


    --If the reply is helpful, please Upvote and Accept as answe

    0 comments No comments