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
Tabletop RPGs
Tabletop RPGs

Dashboard
Notifications
Mark all as read
Q&A

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

+9
−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?

1 comment thread

General comments (4 comments)

3 answers

+3
−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 comment threads

+3
−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 comment threads

+0
−3

Others have posted some workarounds that directly answer your question, but my own answer to the implied deeper question ("how do I prevent my [currently Windows 10] machine from rebooting during a long OctoPrint job") is simpler: Use a better, less controlling OS. OctoPrint is available for Linux, and is apparently (per Wikipedia) commonly and successfully run on Raspberry Pi (with a special-purpose distribution called OctoPi even providing it pre-installed). So do any of the following:

  1. Back up your data and install your choice of Linux distribution in place of Windows (I use a custom Debian spin myself, but something like BunsenLabs or CrunchBang++ is probably a user-friendlier starting point, if you're not familiar with Linux already).

  2. Back up your data, partition your hard drive, and install Linux alongside Windows, in a dual-boot setup, and try to gradually learn how to do more and more things in Linux.

  3. Install Linux alongside Windows in a dual-boot setup, use Linux for long print jobs and other uninterruptible tasks, and keep using Windows for everything else (requires that you never need to do something else while in the middle of a print job).

  4. Get a Raspberry Pi and use that for long print jobs and other uninterruptible tasks, and keep using Windows 10 on your existing machine for everything else.

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

1 comment thread

This doesn't really answer the question. (3 comments)

Sign up to answer this question »

This community is part of the Codidact network. We have other communities too — take a look!

You can also join us in chat!

Want to advertise this community? Use our templates!