7

Let's say I have a major update for Windows 10, e.g. the feature update to version 1803 or perhaps a larger monthly cumulative update. I want to leave the update running unattended after I start it, perhaps while I'm out of the house, but a restart is needed to complete the update and the active hours are set so that it won't restart itself unless it's nighttime.

Can I tell Windows to restart as soon as the updates are finished, regardless of the current time or whether there are applications running?

My main desktop runs Windows 10 Pro, so Group Policy is an option, but an answer that does not require Pro features is preferred.

2
  • There are numerous group policies that control the behavior of Windows Update, but consumer versions both work in the same way, an update is installed typically either when you schedule it to happen or you manually restart the machine. How long you can go between when the updates are pending to the actual restart depends on the edition of Windows you have. If you want an update to be installed, immediately after it's installed, it's going to require to use WSUS and those group policies. Since I don't know how to do that specifically I will refrain from submitting an answer.
    – Ramhound
    Commented May 4, 2018 at 18:07
  • 2
    I recall that events are written to the Event Logs by WU. If there's one that indicates all pending updates have been installed...or that there's pending reboot...a script could easily monitor for this and kick off the required restart. Commented May 14, 2018 at 22:32

3 Answers 3

4

Can I tell Windows to restart as soon as the updates are finished, regardless of the current time or whether there are applications running?

Almost.

See the Microsoft Docs: "Manage device restarts after updates":

"You can use Group Policy settings, mobile device management (MDM) or Registry (not recommended) to configure when devices will restart after a Windows 10 update is installed. You can schedule update installation and set policies for restart, configure active hours for when restarts will not occur, or you can do both.".

What do I mean by "almost"?, if it's active hours and an update has been installed the computer might want to wait and warn you before rebooting out from under you. That's the "almost" part, during active hours it needs to wait, offer a warning, then if you don't cancel it will reboot - there's not a 'constantly detect if I'm away during active hours' unless you set a very short scheduling delay (which would catch you if you were using the computer and got called away).

Read on at that link (which is on the Microsoft website, so it should remain up to date and redirect if moved; alternatively there's WayBack):

"Schedule update installation

In Group Policy, within Configure Automatic Updates, you can configure a forced restart after a specified installation time.

To set the time, you need to go to Configure Automatic Updates, select option 4 - Auto download and schedule the install, and then enter a time in the Scheduled install time dropdown. Alternatively, you can specify that installation will occur during the automatic maintenance time (configured using Computer Configuration\Administrative Templates\Windows Components\Maintenance Scheduler).

Always automatically restart at the scheduled time forces a restart after the specified installation time and lets you configure a timer to warn a signed-in user that a restart is going to occur.

While not recommended, the same result can be achieved through Registry. Under HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU, set AuOptions to 4, set the install time with ScheduledInstallTime, enable AlwaysAutoRebootAtScheduledTime and specify the delay in minutes through AlwaysAutoRebootAtScheduledTimeMinutes. Similar to Group Policy, AlwaysAutoRebootAtScheduledTimeMinutes sets the timer to warn a signed-in user that a restart is going to occur.

For a detailed description of these registry keys, see Registry keys used to manage restart.

There is additional information about: "Always automatically restart at the scheduled time", "Engaged restart", "Scheduled auto-restart warnings", etc. simply find a combination of settings that works for you without causing too long a wait while unattended (even during active hours) nor commits you to reboot without the opportunity to abort for a period of time.

Maybe a 10 minute warning and a two hour schedule will work for you, a setting to 'download and immediately reboot while I'm away' wouldn't work for the incessant interruptions, a half hour schedule might work if you are anxious to apply updates over any annoyance from being pestered to allow a reboot.

1

Here's a quick and dirty solution that I've used many times, it's never failed me, but it's not very sophisticated either (sure is easy though).

I guess at how much longer it's going to take, and give it extra time (e.g. 'this won't take more than an hour, I'll give it two'), then I open a command prompt, and start a countdown for that long (TIMEOUT 7200 because 2 hours = 7200 seconds), have it wait till the command finishes (&&), then have it run the shutdown command to reboot the computer.

TIMEOUT 7200 && shutdown -r

You can also use any of the shutdown command's other parameters to e.g. shut down (-s), reboot (-r), reboot and relaunch open apps if possible (-g).

And I recommend that you also add the /NOBREAK argument to the TIMEOUT command so that if the command prompt window has keyboard focus, and the keyboard gets bumped it won't suddenly, and unexpectedly run the shutdown command.

TIMEOUT 7200 /NOBREAK && shutdown -g
0

This feature was implemented in Windows 10 version 1903. It can be enabled in the Windows Settings app, in Update & Security > Windows Update > Advanced options:

Windows Update settings Windows Update advanced settings, showing the option to restart immediately after installing an update

You must log in to answer this question.

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