Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users

Dashboard
Notifications
Mark all as read
Q&A

How to stop all automatic Windows Update restarts on a Windows 10 Pro machine?

+7
−0

I have Octoprint on a Windows 10 computer to print to an Ender 5, it's fairly often that prints will go overnight and around 15-16 hours.

If Windows Updates plus a restart were to happen during that time it will be a major problem.

How can I turn off automatic Windows Updates that will restart the computer without user input?

Why does this post require moderator attention?
You might want to add some details to your flag.
Why should this post be closed?

3 comments

I believe the different editions of Windows 10 differ in this regard, so it might help if you specify which you are interested in. Also, do you need to completely prevent updates, or is it sufficient to be able to postpone the installation of updates? Canina‭ 9 days ago

@Canina 10 Pro, need to make sure that the computer doesn't restart without me telling it to Charlie Brumbaugh‭ 9 days ago

You can tell it to prompt for it and set a time or schedule when the update will happen. But I don't think it is possible to stop the update train. Also if you aren't around to tell it when you want it to do an update, it will eventually do the update anyway. The only solution I know of is to switch to Windows 7 or a server flavour of Windows. Lundin‭ 8 days ago

2 answers

+2
−0

Windows 10 allows you to set "office hours" during which it won't automatically reboot. Unfortunately, it doesn't allow you to set the entire day as office hours. So the trick is to change your office hours frequently in such a way that it's always office hours.

https://github.com/Maimer/update-active-hours contains a simple implementation of this trick; I have an uncommitted fork which offsets 1 hour back in the past - I can't remember, but I may have found that this was necessary.

update_active_hours.ps1:

$registryPath = "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings"

if (Test-Path -Path "${registryPath}") {
  $currentHour = (Get-Date).hour
  $activeHoursStart = $currentHour - 1
  if ($activeHoursStart -lt 0) {
	$activeHoursStart = $activeHoursStart + 24
  }
  $activeHoursEnd = $activeHoursStart + 12
  if ($activeHoursEnd -gt 23) {
	$activeHoursEnd = $activeHoursEnd - 24
  }
  Set-ItemProperty -Path "${registryPath}" -Name "ActiveHoursStart" -Value "${activeHoursStart}"
  Set-ItemProperty -Path "${registryPath}" -Name "ActiveHoursEnd" -Value "${activeHoursEnd}"
}

This is run by a scheduled task which executes every 6 hours with action

Powershell.exe -ExecutionPolicy Unrestricted -File path\to\update_active_hours.ps1
Why does this post require moderator attention?
You might want to add some details to your flag.

0 comments

+2
−0

You can pause updates for a while, which should be good enough for your use case. The following looks like it'll work on at least Windows 10 21H1 Pro.

Go into Settings -> Windows Update, and select Pause updates for [X] days.

When the task is complete, it's probably a good idea to manually go back into Windows Update settings and select to resume updates.

Alternatively, also under Settings -> Windows Update, you can go into Advanced options to manually select the pause duration.

Why does this post require moderator attention?
You might want to add some details to your flag.

0 comments

Sign up to answer this question »