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,063
    3,361
    90
    #141 pf100, Feb 24, 2018
    Last edited: Feb 24, 2018
    (OP)
    Some people have a wub_task with the wrong settings. Better to delete and recreate the task every time for now. Let's give it some time for everyone to update and then I can easily change the script so it checks for the task first before creating it.
     
  2. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    13,139
    64,323
    340
    The task Command starts the task xml file
    i suppose it should be "%~dp0wub.exe" not "%~dp0%Task_Name%.xml"
     
  3. pf100

    pf100 Duct Tape Coder

    Oct 22, 2010
    2,063
    3,361
    90
    You're right. I fixed it in line 118. Thanks for that @abbodi1406. I'll update the script now.
     
  4. pf100

    pf100 Duct Tape Coder

    Oct 22, 2010
    2,063
    3,361
    90
    @Tiger-1 Install v2.2.1 or the needed wub_task won't work.
     
  5. Tiger-1

    Tiger-1 MDL Guru

    Oct 18, 2014
    7,108
    8,777
    240
    OK thanks for the info bro :)
     
  6. Okay, this is what happened with me.
    i'm already using wub to stop updates before.
    I downloaded your script from majorgeeks.
    i ran the script, wumt shows me some updates are available. but i browsed the wumt little while, like drivers, installed updates etc.
    to check whats happening in the default windows update, i opened it. and i saw that it is already downloading monthly cumulative updates.
    there was no pending updates, bcoz last time when i disabled updates in wub, i made sure that all updates are successfully installed.

    but here is a catch, in wumt, in lower left corner, there is a option to change updates to notification, disabled etc. if anyone change those options, then it will force the default windows update to check for updates. and once it checks then it will download and install.
    but in my example i didnt touch those update options.
    but in wumt if anyone touch those option during running your scripts then default windows update will download and install updates simultaneously with wumt.

    so what i am suggesting is that, in my problem case, if you use "also" set manual update in opening script and in closing set it to restore then it would not cause problems like mine.

    but if anyone change update option in wumt during running your script then "set manual update and wub" both methods will fail.
     
  7. My other feedback-
    using wub in your script is actually a problem, bcoz store downloading and defender update (in old win 10 ver with old gui defender) dont work.
    but if you use manual update method instead of wub in your script then, default windows update wont update automatically and we can use wumt to decide which update we want or dont want. this will solve all the problems. it may be possible that in future ms change this but until then we can use this option.
     
  8. kabutopepe

    kabutopepe MDL Novice

    Feb 18, 2018
    22
    6
    0
    I had updates disabled to be downloaded auto on group policy before apying the script and wub , maybe you should do the same . The more security layers you have the better
     
  9. pf100

    pf100 Duct Tape Coder

    Oct 22, 2010
    2,063
    3,361
    90
    I don't know how it's downloading cumulative updates in the background. This is the first report I've had of that. I hate that it happened to you and I'm interested in knowing why.

    I wouldn't change any settings while running WUMT through the script, just install and hide updates. It's all automated. If you realize you want to change settings after starting the script, just let it open WUMT and then manually close it right away. But really, it should show you drivers and everything in WUMT for you to select to hide or install anyway, so it shouldn't matter.
    And here: What do you mean, "set manual update"? If you have a setting for that, I'd love to hear about it. >> "if you use "also" set manual update in opening script and in closing set it to restore then it would not cause problems like mine"
     
  10. pf100

    pf100 Duct Tape Coder

    Oct 22, 2010
    2,063
    3,361
    90
    Have you noticed how microsoft is making it harder and harder to disable updates? Wub isn't a problem, it's part of a solution to one. The store works if you let WUMT finish checking for updates first, before you start updates or close it. Defender updates don't work and that's something I can't fix.

    Again, what manual update method are you talking about? I've been using this script for a long time and the only time I wasn't able to choose my updates was when I closed WUMT after it checked for updates when it shows you the updates and you're supposed to select them or hide them.
     
  11. @pf100
    thousands of people are using your script, if anyone touch those update method in wumt then wumt and windows update will start to work at the same time. thats all i'm saying.


    your script disable updates in the end, and after disabling updates you cant download or update apps in store. user would have to enable updates in wub, which can lead to automatic updates installing.


    i'm talking about ghacks trick which i posted in my previous comments. that manual update trick is working in all windows version and edition.

    to set manual updates (update only work when you click on check for updates, otherwise it doesnt work automatically) run following in cmd
    Code:
    takeown /f "%WINDIR%\System32\UsoClient.exe" /a
    icacls "%WINDIR%\System32\UsoClient.exe" /remove "Administrators" "Authenticated Users" "Users" "System"
    to restore to automatic updates
    Code:
    icacls "%WINDIR%\System32\UsoClient.exe" /reset
    i think if you use this manual method instead of wub then it would be better and i cant think of a way why it not going to be better than with wub.
     
  12. elzna

    elzna MDL Senior Member

    Aug 28, 2013
    436
    54
    10
    Thanks for all the hard work, pf100 :)
     
  13. i think its perfectly normal that it happened... your script enable windows update, and wumt start, in the mean time if windows update scheduled task kicks in in then its normal.
     
  14. pf100

    pf100 Duct Tape Coder

    Oct 22, 2010
    2,063
    3,361
    90
    @ShiningDog I've taken all of your points into consideration and appreciate the input. I see what you're saying and have been studying these things. This post might help put things in perspective.
     
  15. pf100

    pf100 Duct Tape Coder

    Oct 22, 2010
    2,063
    3,361
    90
    #158 pf100, Feb 28, 2018
    Last edited: Mar 1, 2018
    (OP)
    Edit: Moved code to original post as v2.2.2

    I've not wanted to mess with usoclient before, but it looks like it's unavoidable now.

    I need some testers before I post this as the new version. I tested it on my machines on 1607 LTSB (14393.2097) and 1709 Pro (16299.248). I'd like to hear from Home Users because this should work for you too.

    I updated the script to rename the %programfiles%\rempl folder and kill usoclient. It makes two backups of the original usoclient.exe, and then removes all permissions from the original so it can't run.
    I also included an uninstaller that restores the rempl folder, copies a backup of usoclient.exe back to the original file, and turns off wub which turns the windows update service on automatic again. undoing everything done by the script (except deleting the script folder itself. The user should know where the folder and shortcut is).

    Running the wrapper script again undoes what the uninstaller does, and the uninstaller undoes what the wrapper script does.

    **Don't change "automatic" to something else in the lower left of the WUMT screen while running the script.**
     
  16. pf100

    pf100 Duct Tape Coder

    Oct 22, 2010
    2,063
    3,361
    90