Windows – n Install Updates, Restart, Finish Installing Updates, and then Shutdown

windowswindows update

I get that there's an "Install Updates and Shutdown" option, but it only installs them halfway. Then, when I'm ready to use the computer again and turn it back on I have to wait for the updates to finish installing. Which apparently takes anywhere from 30 minutes to a few hours.

Obviously when I tell it to install updates on shutdown it's because I don't want to wait on it when I'm actually planning on using the computer.

Is there a way to tell it to "Install Updates, Restart, Finish Installing Updates, and then Shutdown"?

Best Answer

  • Unfortunately there is no group policy or command line command that can do this command.

    If your concern is that the computer is running and consuming power, you can use the power settings to hibernate after a certain time in minutes. However, if you only want the computer to hibernate one time for the update, you'll have to manually turn off the automatic hibernate again. To do this:

    1. Access power settings. You can do this by pressing win + r then typing either powercfg.cpl or control.exe /name Microsoft.PowerOptions. If you have a laptop, then you can just right click the battery icon and click on power options.

    2. Then Change Plan Settings > Change advanced power settings then maxmize the Sleep list item, then the nested Hibernate list item. Modify the time in minutes before hibernation.

    If you feel a little fancier, you can also schedule a one time task:

    1. Press win + r then type Taskschd.msc.

    2. Create task

    3. Add a new trigger at startup

    4. Add a new action program/script: shutdown.exe with arguments -s -f -t 60

    5. Go to settings tab, check the "If the task is not scheduled to run again, delete it after:" and set the combo-box to Immediately so the task goes away after it finishes.

    Note: I set the force shutdown time window to be one minute. This is just in case something goes wrong, if it were set to 0 your computer has the potential of shutting down as soon as you startup computer, which would be a problem in of itself. If this does happen for some reason, login quickly, open a cmd or powershell and type in shutdown.exe /a which will abort any pending shutdown command.

    An additional note on hibernating/sleep: only one or the other can be active at one time. You've probably noticed, but you have only the sleep option or the hibernate option when you click the power button in start menu. If you currently have the sleep option on and you want hibernate, open an elevated powershell or cmd (press win + x or right click start button) and then type powercfg /h on to turn on hibernation, and powercfg /h off to turn on sleep/hybrid mode.