Page 6 of 7 FirstFirst ... 4567 LastLast

  1. Joined : Nov 2015
    Posts : 18
    windows 10
       30 Oct 2016 #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 System SpecsSystem Spec


  2. Joined : Oct 2016
    Posts : 6
    Win10 Home
       30 Oct 2016 #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 System SpecsSystem Spec


  3. Joined : Nov 2015
    Posts : 18
    windows 10
       30 Oct 2016 #53

    Batch works perfectly for me too also. Thanks.
      My System SpecsSystem Spec


  4. Joined : Oct 2016
    Posts : 6
    x64 Windows 10 Home Version 1607
       02 Nov 2016 #54

    cbarn said: View Post
    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 System SpecsSystem Spec


  5. Joined : Oct 2016
    Posts : 6
    Win10 Home
       02 Nov 2016 #55

    RS06 said: View Post
    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 System SpecsSystem Spec


  6. Joined : Oct 2016
    Posts : 6
    x64 Windows 10 Home Version 1607
       02 Nov 2016 #56

    cbarn said: View Post
    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: View Post
    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 System SpecsSystem Spec


  7. Joined : Nov 2016
    Posts : 3
    Windows 10
       4 Weeks Ago #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: View Post
    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 System SpecsSystem Spec


  8. Joined : Nov 2016
    Posts : 3
    Windows 10
       4 Weeks Ago #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 System SpecsSystem Spec


  9. Joined : Nov 2015
    Posts : 168
    Windows 10 Home
       4 Weeks Ago #59

    Is this what you all want.....

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


  10. Joined : Nov 2015
    Posts : 18
    windows 10
       4 Weeks Ago #60

    SonicBlue said: View Post
    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 System SpecsSystem Spec


 
Page 6 of 7 FirstFirst ... 4567 LastLast


Similar Threads
Thread Forum
Windows Update Automatic Restart
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...
Windows Updates and Activation
Prevent Automatic Upgrade to Windows 10
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...
Windows Updates and Activation
Solved How to prevent windows from turning on hard drives to restart?
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...
Performance & Maintenance
Solved How do I prevent automatic window resizing?
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...
General Support
Prevent the automatic downloading of its updates
Hi In Windows 10 build 10130, how do I prevent the automatic downloading of its updates? Thanks Bye
Installation and Setup
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 12:19.
Find Us
Twitter Facebook Google+



Windows 10 Forums