Sledgehammer - Windows 10 Update Control

Discussion in 'MDL Projects and Applications' started by pf100, Nov 28, 2016.

  1. pf100

    pf100 Duct Tape Coder

    Oct 22, 2010
    2,069
    3,447
    90
    #1 pf100, Nov 28, 2016
    Last edited: Nov 1, 2020
  2. pf100

    pf100 Duct Tape Coder

    Oct 22, 2010
    2,069
    3,447
    90
  3. rpo

    rpo MDL Expert

    Jan 3, 2010
    1,446
    1,421
    60
    Here is an updated version of the script concerning the way to get the os architecture.
    :: ********************************************************************
    :: Put the .cmd script and the Windows Update MiniTool in the same
    :: folder/location i.e. X:\WindowsUpdateControl.
    :: *******************************************************************
    :: This utility enables automatic updates,
    :: then runs the Windows Update MiniTool,
    :: and then disables automatic updates
    :: giving you full control. No more automatic
    :: update reboots.
    :::::::::::::::::::::::::::::::::::::::::
    :: Automatically check & get admin rights
    :::::::::::::::::::::::::::::::::::::::::
    @echo off
    CLS
    ECHO.
    ECHO =============================
    ECHO Running Admin shell
    ECHO =============================
    rem
    REM Check Privileges
    chcp 1252 >nul 2>&1
    net.exe session >nul 2>&1 || (
    REM Get Privileges
    rem
    rem **************************************
    rem Invoking UAC for Privilege Escalation
    rem **************************************
    ECHO Set UAC = CreateObject^("Shell.Application"^) > "%temp%\OEgetPrivileges.vbs"
    ECHO UAC.ShellExecute "%~0", "", "", "runas", 1 >> "%temp%\OEgetPrivileges.vbs"
    "%SystemRoot%\System32\WScript.exe" "%temp%\OEgetPrivileges.vbs" %*
    exit /B
    )
    REM Got Privileges
    if exist "%temp%\OEgetPrivileges.vbs" del /f /q "%temp%\OEgetPrivileges.vbs" >nul 2>&1
    chcp 850 >nul 2>&1
    rem
    ::::::::::::::::::::::::::::
    ::START
    ::::::::::::::::::::::::::::
    echo ******************************************
    echo This utility enables automatic updates,
    echo then runs the Windows Update MiniTool,
    echo and then disables automatic updates
    echo giving you full control. No more automatic
    echo update reboots.
    echo ******************************************
    echo Press any key to continue.
    @echo off
    pause >nul
    cls
    echo *** Enabling Windows Updates ***
    @echo on
    sc config wuauserv start= auto
    net start wuauserv
    @echo off
    echo **********************************************************
    echo Don't close this window or automatic updates will stay on!
    echo **********************************************************
    REM Check OS
    for /f "tokens=2 delims==" %%a in ('wmic cpu get AddressWidth /value') do (set arch=%%a)
    IF %arch% == 32 (set arch=86)

    start "Executing WUMT" /wait "%~dp0wumt_x%arch%.exe" -update
    @cls
    @echo off
    echo *******************************************************************
    echo Press a key to disable automatic updates (recommended), or
    echo ctrl-c to exit and leave automatic updates turned on (if you must).
    echo *******************************************************************
    pause > nul
    @echo on
    sc config wuauserv start= disabled
    net stop wuauserv
    @echo off
    echo **************************
    echo Windows Update Completed.
    echo Press a key to exit.
    echo **************************
    pause > nul
     
  4. lobo11

    lobo11 TOMAHAWK CHOP

    Feb 16, 2012
    6,584
    5,362
    210
    Anyway to let Windows Defender updates through WMUT and still keep it in notification mode for everything else :D
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. pf100

    pf100 Duct Tape Coder

    Oct 22, 2010
    2,069
    3,447
    90
    #5 pf100, Nov 28, 2016
    Last edited: Apr 23, 2018
    (OP)
    Thank you, rpo.

    Good question. I have three ideas about that:

    1) WUMT would have to be modified (is the source code available?). Add code: IF update name contains "defender" automatically install it, ELSE treat all other updates normally. But that would require leaving the windows update service turned on which defeats the purpose of the wumt wrapper script.

    2) a script running as a scheduled task that checks for windows defender updates that would download and install them whether the windows update service is turned off or not, and whether wumt is running or not.

    3) We all meet up at 1 Redmond Way, storm the building, and force them to make updates completely customizable.
     
  6. lobo11

    lobo11 TOMAHAWK CHOP

    Feb 16, 2012
    6,584
    5,362
    210
    Mr.X, any ideals? :confused:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. Nongshim

    Nongshim Guest

    So your scripts in the OP is the most updated? Also a stupid question, do I paste this into notepad and affix a .cmd?
     
  8. pf100

    pf100 Duct Tape Coder

    Oct 22, 2010
    2,069
    3,447
    90
    Yes, the OP is the latest. And yes, just paste into notepad and add .cmd to the end of the script name.
    (Sorry about the confusion, I'll delete the post announcing the previous update to the lastest update.)
     
  9. Tiger-1

    Tiger-1 MDL Guru

    Oct 18, 2014
    7,897
    10,733
    240
    @pf100 thanks a lot dude for your very good application, still I believe is one the best applications made here on MDL and congrats for your big effort and dedication with all members :clap::)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. pf100

    pf100 Duct Tape Coder

    Oct 22, 2010
    2,069
    3,447
    90
    Thank you Tiger-1. I appreciate your kind words, it means a lot to me because people who've never tried it give me crap about it. I wish more people would give it a try to see how well it works. Oh well, I'll just keep improving it and ignore people who try to bring me down.
     
  11. Tiger-1

    Tiger-1 MDL Guru

    Oct 18, 2014
    7,897
    10,733
    240
    @pf100 don't worries dude, simply continues developing good and useful applications is what interest who know your job can show for all here simply continue so :good3:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  12. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,104
    24,378
    340
    When promoting and maintaining any kind of tool in the 'open', you first need to get rid of a too emotional way to look at your own project. It helps to keep the needed distance :D.

    Keep an eye on the users that provide info regarding errors and participate with constructive criticism.

    Then there will ALWAYS! come those, that never read instructions before trying the wildest things, especially if something fails at first for them.

    Can sing songs from JATD thread, you simply cannot implement enough warnings, if people are unwilling to read and comprehend. And parts of JATD can effectivly nuke a system if handled impropperly.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  13. Nongshim

    Nongshim Guest

    So does the update service stay disabled after a manual reboot (from start menu)? Or do I have to run the WinUpdates.cmd again after reboot?
     
  14. rpo

    rpo MDL Expert

    Jan 3, 2010
    1,446
    1,421
    60
    Yes, it does.
     
  15. pf100

    pf100 Duct Tape Coder

    Oct 22, 2010
    2,069
    3,447
    90
    #15 pf100, Mar 6, 2017
    Last edited: Mar 6, 2017
    (OP)
    You no longer need to close WUMT after an update and manually reboot anymore. The script automatically turns off the windows update service after you click "reboot" from WUMT. In other words, just run the script and if WUMT presents you with an option to reboot after updating, you can now click "reboot" and the update service will be automatically turned back off before reboot.
    Edit: I was working on a friend's computer the other day and her metered wifi connection become un-metered when I updated the wifi driver from windows update, so metered connections can't be trusted no matter what all the gurus are telling me.
     
  16. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,104
    24,378
    340
    orly....................?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  17. pf100

    pf100 Duct Tape Coder

    Oct 22, 2010
    2,069
    3,447
    90
    Yep. Wifi metering turned itself off. I couldn't believe it. And this friend is on a bandwidth limited satellite internet connection (lives out in the middle of nowhere). One of the the first things I checked when I started working on her computer was that metering was turned on. The reason I was working on her computer was that the wifi kept disconnecting and the latest driver fixed it. When I was all done, just before I left, I checked that metering was still on and Windows 10 had turned it off! I turned it back on, but who knows when it'll turn itself off again?
     
  18. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,104
    24,378
    340
    Installing a new driver will most likely cause a settings reset connected to that driver :g:. I would always check the settings afterwards.

    My Ethernet is set to metered (by altering ,TI owned Reg value) and wasn't touched by the system for a while now.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  19. pf100

    pf100 Duct Tape Coder

    Oct 22, 2010
    2,069
    3,447
    90
    That makes sense of why metering turned itself off, and thanks for that, but it's still just another reason I don't trust Windows Update settings. If you turn metering on it should stay on, but under the conditions of installing a new network driver, ethernet or wifi, it doesn't. So the metering setting can't be trusted. If I find out that the windows update service turns itself on by itself, and I've heard stories but no one has given me a specific situation where it does, then I will incorporate the windows update blocker service into the script. So far that hasn't been necessary. If it ever becomes necessary I have permission of the author of the service to incorporate it. I will continue to work to make the update service fully manual under any circumstances. Now, if you'll excuse me I have some serious gaming to do that won't be interrupted by windows searching for updates...
     
  20. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,104
    24,378
    340
    So far my setting at least survived two cumulative updates, let's wait what Creators Update will bring.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...