Windows 10: How to Prevent automatic restart in Windows 10 Anniversary Update?
Yeah, I suspect that it would work.
Well, only one way to find out ... I tracked down the registry entries, and I've created three scheduled tasks that use C:\Windows\System32\REG.EXE to update the window. Kind of brute-forced it this way, but it's good for a test. Every 8 hours a task runs that establishes a new 10 hours window, using these parameters:
ADD HKLM\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings /v ActiveHoursStart /t REG_DWORD /f /d 1
ADD HKLM\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings /v ActiveHoursEnd /t REG_DWORD /f /d 11
The value after /d is the new hour for that key. It'd be more elegant to write a script that can run at anytime and set a window based on the current hour, and that's actually kind of necessary because a shutdown of any significant length could push you outside the defined window and allow a reboot not too long after you came back up (but hopefully you would've been updated then anyway!)
Now the wait for a critical update that tries to force a reboot ...
Last edited by Brink; 26 Oct 2016 at 19:23.
Reason: added tutorial link for more info
I could be missing something, but I don't see how this works, because that just sets the active hours to 1am-11am. Instead, it needs to be relative to whatever time the UpdateOrchestrator->Reboot scheduled task is set to reboot the machine at. It always needs to keep that time within the active hours window, so that whenever Windows runs the Reboot scheduled task, it discovers that it is trying to do so within the active hours (after which, Windows reschedules Reboot to a new time in the future, just outside of the active hours window).
So, you need to be checking when the Reboot scheduled task is meant to run, and update the active hours accordingly.
Continually hyper vigilant about forced updates, last night I checked my system tray. NO NOTIFICATIONS. I then checked for updates and found I had updates ready to download. The notice also stated Windows wouldn't download them until my system was idle. BUT... the (stupidly inadequate) 12 hour "active use" selection was on during that time. I checked earlier in the day when it was off and there were no updates to download.
I don't know if the "active hours" pertains only to restarts, or if it also includes not downloading the updates which would then need a restart to install. I'd REALLY LIKE TO KNOW because I also have "NoJiggle" installed which is supposed to keep Windows from entering the idle state. If downloads proceed during "active hours", it would appear "NoJiggle" worked.
Weighing another instance of data loss against testing "NoJiggle" any farther, I chickened out, downloaded the updates, and did a manual restart during a time when I didn't have any scheduled TV programs currently recording on NextPVR via my HDHomerun tuner.
Where did you download NoJiggle? I could not find it.
Oops! So sorry, I conflated the names of two .exe programs (Don't Sleep and MouseJiggler) into one non-existent program. The actual name of it is "MouseJiggler" which when downloaded is "MouseJiggle.exe"
I got it from the source: Mouse Jiggler - Home
Even after I successfully got it into system start Windows10 nanny didn't allow me to deploy it beyond a single instance, always preceded by dire warnings. So to get it to stick in the system tray, I had to remove Windows protection from ALL unknown applications. (really?? seriously??) But still whenever I do a restart, "MouseJiggle reappears to ask me if I want to run it, and if so, active or zen mode, then the green arrow to send it to the systray. I've chosen active mode so the mouse actually moves about once every second. I'm guessing zen mode is similar to "Don't Sleep" which purports to prevent screen savers, etc., but can be over-riden during a forced restart.
Will "MouseJiggler" prevent my computer from entering the idle state and defer the downloads which lead to forced updates? Or allow downloads but defer updates until the computer is idle? Or will Windows updates just continue trampling over everything and forcing restarts?
Yes, you're missing something ... that's just an example of the commands, I actually have three jobs set to run:
- At 2am, active hours are set to 1am-11am
- At 10am, active hours are set to 9am-7pm
- At 6pm, active hours are set to 5pm-3am
Brute forced and ugly, but at least good for a test - and so far, it's working: I got a notice over 24 hours ago that a reboot was required and nothing has happened.
If this was a desktop that was always on, I'd just leave it as-is, 6 lines of code and 3 scheduled tasks would do the trick. However, this is my laptop, so it's more complicated - if I sleep the system, it could miss one of those reset jobs and wake up outside the window (triggering a reboot). I can't just tell set the jobs to "run if missed" because they could run in the wrong order and wind up outside the window as well. I'm thinking a simple job that runs hourly and sets the working window based on that hour - it can be set to run if missed and still do the right thing, and it doesn't have to actually refer to the reboot job's time. Could still glitch (reboot could run before it does) but I'm not sure I can 100% avoid that.
Since the brute-force method was working, I cleaned it up. I've got this batch file (yeah, batch, I'm that old) scheduled to run at startup and repeat every hour after that:
Fun integer math included to make sure it rolls over the hour properly at midnight.
:: RebootBlock - Blocks automatic reboot by setting the "Active Hours" to
:: Now thru Now+10hrs. Schedule as an hourly task with:
:: - A user authorized to run "REG" (normal priv user should work)
:: - Run whether user is logged on or not
:: - Hidden
:: - Scheduled at startup and repeats hourly forever
:: - Program is "c:\windows\system32\cmd.exe"
:: - Argument is /c and path to this batch
:: - Provide path in "Start in (optional):" or scheduler may not run it!
:: - Run task as soon as possible after scheduled start is missed
:: Verify proper operation in Scheduler and via REGEDIT before relying on this!
setlocal EnableExtensions DisableDelayedExpansion
for /f "delims=:" %%1 in ('echo %time%') do SET STARTTIME=%%1
set /a ENDTIME=%STARTTIME% + 10
set /a ADJUST=(%ENDTIME% / 24)*24
set /a ENDTIME=%ENDTIME% - %ADJUST%
REG ADD HKLM\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings /v ActiveHoursStart /t REG_DWORD /f /d %STARTTIME%
REG ADD HKLM\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings /v ActiveHoursEnd /t REG_DWORD /f /d %ENDTIME%
Last edited by cbarn; 29 Oct 2016 at 13:08.
Reason: Edited because "TIME /T" returns 12-hour time, BAD - "echo %time%" returns 24-hour time, GOOD!
Well I haven't had a problem at all since disabling the Windows Update service. The service doesn't even become re-enabled when Windows is restarted. Just have to remember to manually check for updates every so often.
Yes, that is the simplest solution, but not for people, who use Windows Defender or Store.
Hello, I just wanted to say here on the forums that making the Windows update restart my computer automatically, no matter what, is ridiculous. The last time the update had restarted my computer while I was using it, I went and put the settings to...
I support a large community of seniors. Typically I have them running Automatic Updates, because they don't want to do their own maintenance. The most common complaint they come in with is there computers are really slow. It usually turns out...
edit: nevermind found answer while looking for something totally unrelated. Wonder why search didnt find it. Ca sara sara
I have 2 external hard drives that are always on but in sleep mode until I need them.
I want to be able to...
In Windows 7, I knew how to turn off the annoying (to me) feature that windows were automatically maximized when moved to the edge of the screen. This option no longer seems to be present in the 'ease of access' settings. Any idea if it can still be...
In Windows 10 build 10130, how do I prevent the automatic downloading of its updates?