1

Is it possible to shutdown Windows 10 with a command or a desktop shortcut which first will install pending updates and then shuts down the computer? I know this might be a silly question since most of the people are trying to avoid updates so their computers shut down immediately.

When I use shutdown.exe with /s /t 0 parameters it shuts the computer down but the pending updates are not installed. I know I can use the power button in Start menu but it just takes too many clicks.

It would be superb if this can be achieved only with common Windows components (Powershell included) and without the need of elevated (admin) privileges, but I'm fine with 3rd party tools as well.

1
  • Did you try wuauclt.exe /resetauthorization /detectnow /updatenow before shutdown? Commented Sep 5, 2022 at 17:32

2 Answers 2

1

Yes there is a PS command: Get-WUInstall -AcceptAll -AutoReboot, there should be a shutdown switch as well. I haven't tried it myself though.

Other then that:

Option1: It would be possible to update and restart via command line and shutdown after the update is completed. But it will be a bit more complicated, since the shutdown command has to run once after the update.

Option2: Or you could use one of various 3rd party tools like this command line tool (ShutdownWithUpdates) published on GitHub

Option3: Use this script published on serverfault (written for Windows 7).

1

Yes, but the shutdown command doesn't support this directly. Using the usoclient.exe to perform the scan and install the update followed by shutdown /r does work (just tested).

usoclient StartInteractiveScan
shutdown /r

Third party software option is https://dennisbabkin.com/shutdownwithupdates/.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .