How to Prevent automatic restart in Windows 10 Anniversary Update?

Page 6 of 8 FirstFirst ... 45678 LastLast

  1. Posts : 28
    windows 10
       #51

    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.
      My Computer


  2. Posts : 6
    Win10 Home
       #52

    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. :)
      My Computer


  3. Posts : 28
    windows 10
       #53

    Batch works perfectly for me too also. Thanks.
      My Computer


  4. Posts : 6
    x64 Windows 10 Home Version 1607
       #54

    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.
      My Computer


  5. Posts : 6
    Win10 Home
       #55

    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.
      My Computer


  6. Posts : 6
    x64 Windows 10 Home Version 1607
       #56

    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!
      My Computer



  7. Posts : 3
    Windows 10
       #57

    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.
      My Computer


  8. Posts : 3
    Windows 10
       #58

    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.
      My Computer

  9. SonicBlue's Avatar
    Posts : 222
    Windows 10 Home
       #59

    Is this what you all want.....

    [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU]"NoAutoRebbotWithLoggedOnUsers"=dword:00000001
      My Computer


  10. Posts : 28
    windows 10
       #60

    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.
      My Computer


 
Page 6 of 8 FirstFirst ... 45678 LastLast

Related Threads
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 11:11.
Find Us




Windows 10 Forums