Remember: Windows 10 will automatically restart for updates

Note to self: If you have anything important running on your Windows 10 computer for a longer time (e.g. over night), make sure to prevent Windows Update to become active. It will force a restart of your computer if it fancies so, regardless of the programs that might still be active.

Guess what happened last night? I not only lost some work but it also aborted a critical maintenance task running for our server infrastructure, which means I have to repeat that task next weekend and endanger company data for another week.

Judging by the results of search for "prevent windows reboot" I am not the first one who got hit by this "feature".

(And to add insult to injury I was now looking for the settings to disable automatic updates for a while and can’t bloody find it. Entering "Windows Update" into the search field of the control panel doesn’t find it.
The search box in the start menu does find it though. WTF?)

Of course as of Windows 10 users can no longer prevent Windows Update to restart their computer (We’re Microsoft, we know best 🙁 ). They have only the following options:

  1. Pause Windows Update for 7 days.
  2. Pause Windows Update until a fixed date, which can be up to about 1 month into the future.
  3. Set the “active hours”, that is the times between which Windows Update will not restart your computer. That period is limited to up to 18 hours.

On Windows 10 professional (home users are out of luck) there are some settings in the Local Group Policy Editor which might help here, but I haven’t yet figured out what to set. One that looks promising is:

No auto-restart with logged on users for

Specifies that to complete a scheduled installation, Automatic Updates will wait for the computer to be restarted by any user who is logged on, instead of causing the computer to restart automatically.

If the status is set to Enabled, Automatic Updates will not restart a computer automatically during a scheduled installation if a user is logged in to the computer. Instead, Automatic Updates will notify the user to restart the computer.

Be aware that the computer needs to be restarted for the updates to take effect.

If the status is set to Disabled or Not Configured, Automatic Updates will notify the user that the computer will automatically restart in 5 minutes to complete the installation.

Note: This policy applies only when Automatic Updates is configured to perform scheduled installations of updates. If the “Configure Automatic Updates” policy is disabled, this policy has no effect.

But unfortunately that policy is already enabled and obviously didn’t prevent the restart last night. I guess that’s what the “Note” is about. The Configure Automatic Updates policy is disabled. I guess I’ll have to figure out what to configure there.

But why is there no option like "Don’t restart if a user is logged on and a program is running."? For their own programs (e.g. Explorer or anything MS Office) they could create fancier solutions as "If a program is running but doing nothing, notify it (e.g. an Explorer window or MS Word with an unchanged document) and restart it afterwards.".

If I remember correctly there is some Win32 API option to prevent manual shutdowns or restarts. Maybe that will also prevent a restart caused by Windows Update.

Edit: Within a few minutes after I posted this, several people have made me aware of Ulrich Decker’s Reboot-Blocker tool. Thanks everybody!