Sledgehammer - Windows 10 Update Control

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

  1. zylor

    zylor MDL Junior Member

    Feb 25, 2012
    92
    49
    0
    nvm
     
  2. zylor

    zylor MDL Junior Member

    Feb 25, 2012
    92
    49
    0
    Windows Update Blocker was updated to 1.6 from sordum.org. They added a lot of options and switches. Maybe its worth updating in the upcoming version of sledgehammer?
    changelog of it:
    Nsudo was also updated to 8.2 and so on.....

    WUMgr isn't blocking updates on latest version of windows for some reason
     
  3. Whistler4

    Whistler4 MDL Member

    Jul 30, 2015
    204
    194
    10
    #1843 Whistler4, Aug 6, 2021
    Last edited: Aug 25, 2021
    I'd be happier if one of the changes would finally stick it in the system tray so you could get a constant monitor showing whether blocking is on or off. Oh, well . . . Service tray works for that part once you have its scheduled task worked out.
     
  4. pf100

    pf100 Duct Tape Coder

    Oct 22, 2010
    2,069
    3,449
    90
    The versions included with the script do everything needed. Windows Update Blocker will be updated in the next version, but not to version 1.6. Upgrading stuff just to increase the version number when there is no benefit makes no sense.
    That has nothing to do with the script or how well the script blocks updates.
     
  5. rpo

    rpo MDL Expert

    Jan 3, 2010
    1,447
    1,424
    60
    @pf100 :
    I'm doubtful when looking at statements like :
    Code:
    CHOICE /C D1234 /M "Your choice?:" >nul 2>&1
    because error and text are redirected tu NUL, so Your choice?: is not displayed. Just remove >nul 2>&1 from this statement.
    PS : I hope everything is OK with your health.
     
  6. Whistler4

    Whistler4 MDL Member

    Jul 30, 2015
    204
    194
    10
    Perhaps this is already well-known, but WuMgr under Sledgehammer won't display any updates if you've paused updates with the Windows 10 Settings. After AskWoody gave the all clear for August updates, I just noticed that a couple of my computers came up with blank updates available in WuMgr. While still running WuMgr, I checked the Windows 10 Update Settings and found that I'd forgotten I had paused updates until August 31. So I clicked "Resume" to fix that issue.

    (Sledgehammer prevents the Windows 10 Update Settings screen from displaying, so the check needs to be done while Sledgehammer is enabling the service. I had paused the updates last month in between installs of Sledgehammer while I was performing other maintenance.)

    Clipboard01.jpg
     
  7. pf100

    pf100 Duct Tape Coder

    Oct 22, 2010
    2,069
    3,449
    90
    #1848 pf100, Aug 26, 2021
    Last edited: Sep 5, 2021
    (OP)
    Thanks for the info. I'll fix that. And my health is priority number 1. I've heard the sad stories of people not making it a priority and either committing suicide or some other horrible thing and I'm going to make sure something like that doesn't happen to me. I don't feel suicidal, I'm just saying mental health is extremely important to me. Thanks for the thoughts.

    Thanks for that info. I didn't know that was a thing because I've never paused updates before because I always use the script on everything. Just off the top of my head I can think of a few options:
    1. When the script is run, force un-pause updates without notification
    or
    2. Check if updates are paused and notify with the option to unpause them

    I did a quick check just now (this could be the wrong key) and it appears that the key to check for paused updates is:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings
    PauseUpdatesExpiryTime

    and maybe an overkill method to force unpause would be
    Code:
    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsUpdate\UpdatePolicy\PolicyState]
    "IsDeferralIsActive"=dword:00000000
    "PolicySources"=-
    "QualityUpdatesPaused"=-
    "QualityUpdatePausePeriodInDays"=-
    "FeatureUpdatesPaused"=-
    "FeatureUpdatePausePeriodInDays"=-
    "PauseFeatureUpdatesStartTime"=-
    "PauseFeatureUpdatesEndTime"=-
    "PauseQualityUpdatesStartTime"=-
    "PauseQualityUpdatesEndTime"=-
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsUpdate\UpdatePolicy\Settings]
    "PausedFeatureStatus"=dword:00000000
    "PausedQualityStatus"=dword:00000000
    "PausedFeatureDate"=-
    "PausedQualityDate"=-
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings]
    "PauseFeatureUpdatesStartTime"=-
    "PauseQualityUpdatesStartTime"=-
    "PauseUpdatesExpiryTime"=-
    "PauseFeatureUpdatesEndTime"=-
    "PauseQualityUpdatesEndTime"=-
    I'm putting this here for notes to come back to later.
     
  8. Carlos Detweiller

    Carlos Detweiller Emperor of Ice-Cream

    Dec 21, 2012
    6,354
    7,070
    210
    I'd take number 2. Forcing things without any notification rather is Microsoft's forte.
     
  9. Whistler4

    Whistler4 MDL Member

    Jul 30, 2015
    204
    194
    10
    That does seem to be the key. If "Pause" activation is detected, can you simply notify and bring up the Settings screen to allow user to click "Resume" (then flip back to where you were in the script)? Probably nothing simple about that -- sorry.

    Another alternative if "Pause" is detected and notification made is to instruct user to DIY navigate to Windows 10 Update Settings and click "Resume" then navigate back to WuMgr (or WUMT) and refresh.

    Even simpler, add a notice before running WuMgr that if updates are expected but none are found, leave WuMgr open, ensure Windows 10 Update Settings are not on Pause, and return to WuMgr and click the refresh scan button.
     
  10. pf100

    pf100 Duct Tape Coder

    Oct 22, 2010
    2,069
    3,449
    90
    It would obviously be best to check for paused updates before the script hides the updates page in settings, at the very latest before line 145 in script 2.7.3 rc1a. Line 115 looks like a winner.

    Then show a message (fancy screen not needed, just basic info) to manually go to updates in settings and unpause updates then return and press a specific key to continue which would then just take you to the first normal screen where it says "updates disabled" as it normally does.

    That would be the easiest way to do it. No one is going to pause updates after the script runs the first time anyway until the script is uninstalled so it'll just be a one time deal. Seems like it would be a very minor inconvenience for the user.
     
  11. zylor

    zylor MDL Junior Member

    Feb 25, 2012
    92
    49
    0
    Thanks for your work!
    Hope everything is well with your health! MDL needs ya buddy! Stay strong :cool:
     
  12. Whistler4

    Whistler4 MDL Member

    Jul 30, 2015
    204
    194
    10
    I agree. The only probable time Pause would be used is before installation/first use or in between installs of Sledgehammer. So checking when the script is run the first time should be good enough.
     
  13. =STARBUCK=

    =STARBUCK= MDL Novice

    Dec 14, 2018
    5
    0
    0
    Does sledgehammer work as well with Windows 11? are there any additional differences from 10 in the update mechanism?
     
  14. pf100

    pf100 Duct Tape Coder

    Oct 22, 2010
    2,069
    3,449
    90
    Yes it works fine. Windows 11 is the same as Windows 10 as far as the update structure goes.
     
  15. Dark Dinosaur

    Dark Dinosaur X Æ A-12

    Feb 2, 2011
    3,758
    5,221
    120
    no need to go so far, here my Sample.
    its put WU in Notify Mode.

    rem define Policies registry key
    set Key="HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU"
    REG ADD %Key% /v NoAutoUpdate /t REG_DWORD /d 0 /f
    REG ADD %Key% /v AUOptions /t REG_DWORD /d 2 /f
    REG ADD %Key% /v ScheduledInstallDay /t REG_DWORD /d 0 /f
    REG ADD %Key% /v ScheduledInstallEveryWeek /t REG_DWORD /d 1 /f
    REG ADD %Key% /v ScheduledInstallTime /t REG_DWORD /d 3 /f
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  16. pf100

    pf100 Duct Tape Coder

    Oct 22, 2010
    2,069
    3,449
    90
    Thanks, but it was decided to not do any of that anyway, and do it manually here.
     
  17. Dark Dinosaur

    Dark Dinosaur X Æ A-12

    Feb 2, 2011
    3,758
    5,221
    120
    It's another way to do it :p
    I like the group policy method
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  18. BT 1

    BT 1 MDL Junior Member

    Feb 16, 2017
    77
    8
    0
    Not for me, i more then often get error - internal failure.

    Right now i am looking for an alternative.
     
  19. pf100

    pf100 Duct Tape Coder

    Oct 22, 2010
    2,069
    3,449
    90
    "Internal failure" is rather vague. That's not much for me to work with.