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
Windows Update Active Hours - Change in Windows 10
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
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.
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?
- 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.
Fun integer math included to make sure it rolls over the hour properly at midnight.@echo off
:: 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.