Windows 10: How to Prevent automatic restart in Windows 10 Anniversary Update?
-
In additional to batch file you can just hide the running batch window, just for preventing stealing focus problems. Instead of starting batch directly just start it via .vbs file
Code:
Dim oShell
Set oShell = WScript.CreateObject ("WSCript.shell")
oShell.run "C:\windows\system32\cmd.exe /c c:\rebootb.cmd", 0, False
Set oShell = Nothing
You must edit path to your batch file.
Task will be pointed to start a program "C:\windows\system32\wscript.exe", arguments is a full path to you vbs file, ex.
"C:\hidereboot.vbs"
Start in — C:\windows\system32\
I run it with "run with highest privileges" option on general tab. Also check 'Run whether user is logged or not" .
Edit:
'Run whether user is logged or not" prevents task to start in my case. It runs manually but in automatic mode it fails with error Error Value: 2147943726 and it can not be fixed with solutions found across the web.
Last edited by woffko; 30 Oct 2016 at 09:27.
-
-
The scheduler job I posted earlier is doing the trick, my system has wanted to reboot for 3 days now and hasn't done it. I still have the notification that a reboot is pending (so good reminder it's going to spend some time updating when I finally reboot), but it hasn't yanked the rug out from under me.
Not the perfect solution for everyone, but it's doing the job for me.
-
Batch works perfectly for me too also. Thanks.
-
-
cbarn said:
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!)
About the script adjusting active hours based on the current time, I wrote a tiny batch script before I saw cbarn's (I'm that old too):
Code:
:: Setting Active Hours Start (AHS) and End (AHE) times to 1 hour before the current time through 9 hours after the current time, i.e., a total of 10 hours window
@ECHO off
set /a AHS=%time:~0,2%-1
IF %AHS% LSS 0 set /a AHS=%AHS%+24
set /a AHE=%time:~0,2%+9
IF %AHE% GTR 24 set /a AHE=%AHE%-24
reg.exe ADD HKLM\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings /v ActiveHoursStart /t REG_DWORD /f /d %AHS%
reg.exe ADD HKLM\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings /v ActiveHoursEnd /t REG_DWORD /f /d %AHE%
It's almost same as what cbarn wrote later as a batch code. Being a paranoid, I suppose it's safer to use Now-1hr through Now+9hrs window though. Glad to know that this method is working for cbarn and woffko. Also, use SYSTEM as the user account to run the task to avoid the cmd window popping up. Thanks for the idea, cbarn!
PS: For anyone new to scheduling, who wants to use it, here's a short guide to do the above trick: https://jpst.it/O_Gs
EDIT: After cbarn's info here, I've updated the batch script and other text to use a 10-hr window, instead of 11
Last edited by RS06; 02 Nov 2016 at 15:01.
-
RS06 said:
Being a paranoid, I suppose it's safer to use Now-2hrs through Now+9hrs window though.
Glad I'm not the only one old enough to use batch, it's actually surprisingly powerful if you bother to learn the idiosyncrasies of it. One of these days I'll get around to learning Powershell (probably 3 months before it gets deprecated).
I used a ten hour window because I read somewhere (which of course I can't find now) that Windows only honored a ten hour window. A little digging shows that it actually varies - on mobile devices it's apparently 18, on desktop/laptop it's 12 at the moment. Since I'm resetting it hourly I suppose it doesn't really matter, but better safe than sorry.
-
cbarn said:
Glad I'm not the only one old enough to use batch, it's actually surprisingly powerful if you bother to learn the idiosyncrasies of it. One of these days I'll get around to learning Powershell (probably 3 months before it gets deprecated).
Yes, I totally agree. It's very malleable and clean, I like that. Never tried Powershell, yet. It's appealing though.
cbarn said:
I used a ten hour window because I read somewhere (which of course I can't find now) that Windows only honored a ten hour window. A little digging shows that it actually varies - on mobile devices it's apparently 18, on desktop/laptop it's 12 at the moment. Since I'm resetting it hourly I suppose it doesn't really matter, but better safe than sorry.
Oh, I didn't know. My batch'll reset it on the edge of the tenth active hour. Still, I'll update my script to be on the safer side. Thanks for the information!
-
Thank you, cbarn
I just encountered this 2 days ago when I opened my laptop for a presentation when, what to my surprise... Murphy struck.
I setup your ActiveHours=[NOW, NOW+10] script in my Task Scheduler and it's running hourly like a dream. Very clever work-around!
I hope that someday Microsoft returns to the kind of control with updates that we had way back when in Win XP.
Big time-saver and much appreciated.
cbarn said:
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.
-
I have an acquaintance who never installed the Anniversary Update and he has control over his updates. Is the Anniversary Update required? If he never updates, will he be in trouble? After I informed him of this thread, he continues to hold off.
Is this what you all want.....
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU]"NoAutoRebbotWithLoggedOnUsers"=dword:00000001
SonicBlue said:
Is this what you all want.....
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU]"NoAutoRebbotWithLoggedOnUsers"=dword:00000001
This does not work on me.