Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- Title WUMT Wrapper Script 2.3.7
- Color 1F & goto start
- Original script by pf100 @ MDL with special thanks to rpo and abbodi1406 @ MDL for code improvements.
- Project page and source code:
- https://forums.mydigitallife.net/threads/72203-WUMT-Wrapper-script-controls-windows-update-service
- ******************************************************************
- You may freely modify this script as you wish, I only request that you leave the credits and the
- link to the original script.
- ******************************************************************
- This script provides manual updating for Windows 10 including Home versions.
- Update Windows 10 on your schedule, not Microsoft's.
- I originally wrote this script for personal use because of the lack of update options with the
- original RTM release of Windows 10 Pro. I wanted to update Windows 10 when I had the free time
- to manually update, just like I did with previous versions of Windows that allowed me to
- set updates to manual, not when Microsoft forced it on me while I was busy using my computer.
- *******************************************************************
- WUMT is available here: https://forums.mydigitallife.net/threads/64939-Windows-Update-MiniTool
- Windows Update Blocker is available here: https://www.dropbox.com/s/a67qj0qzbmx59bm/wub.exe?dl=1
- Only use Windows Update Blocker v1.0 with this script, not v1.1.
- *******************************************************************
- How it works: This script creates a smart Windows Defender Update task "WUD" that updates Windows
- Defender if it's running and enabled, and doesn't update it if it's not running and disabled,
- auto-elevates, uninstalls and removes the Windows 10 Update Assistant, renames the %programfiles%\rempl
- folder disabling remsh.exe, resets and removes permissions from and disables UsoClient.exe, WaaSMedic.exe,
- WaasMedicSvc.dll, WaaSMedicPS.dll, WaaSAssessment.dll, MusNotificationUx.exe, and SIHClient.exe, makes
- sure the task "wub_task" is installed that runs wub at boot (to stop updates from turning updates back on),
- runs wub.exe and enables and starts the windows update service (wuauserv) if disabled
- (*wub can be disabled using the included Configurator.cmd script, leaving Windows Updates always running
- so you can use Store and Defender at any time), then runs the correct version of the Windows Update MiniTool
- in "auto search for updates" mode for your OS version's architecture (x86 or x64), then disables and stops
- wuauserv giving you full control. No more forced automatic updates or surprise reboots. This was written
- for Windows 10 Pro and Home, but works with all versions of Windows 10. Don't change any settings in lower
- left of WUMT while running the script.
- *******************************************************************
- I also included an uninstaller.cmd that deletes the WUD and wub_task tasks, deletes the WDU.cmd file used by WUD,
- restores the rempl folder, resets UsoClient.exe, WaaSMedic.exe, WaasMedicSvc.dll, WaaSMedicPS.dll, MusNotificationUx.exe,
- WaaSAssessment.dll, and SIHClient.exe permissions to how they were originally, and turns off wub (if enabled) which
- turns the windows update service on automatic again, undoing everything done by the script. Running the wrapper
- script again undoes what the uninstaller does, and the uninstaller undoes what the wrapper script does.
- *******************************************************************
- Configurator.cmd leaves remsh.exe, UsoClient.exe, WaaSMedic.exe, WaasMedicSvc.dll, WaaSMedicPS.dll,
- MusNotificationUx.exe, WaaSAssessment.dll and SIHClient.exe disabled, but gives you the option of keeping the windows
- update service running all the time for people who want that option (use Store anytime) You can also
- run it again to reverse changes so that windows updates are set to fully manual but you can't use the
- store anytime (you can after update check before closing WUMT, or using Configurator.cmd to temporarily
- enable the windows update service again).
- *******************************************************************
- *If you need to install .Net 3.5 or use the Windows 10 Store or something that needs wuauserv
- running, run the script and after it enables wuauserv and starts WUMT, install what you need
- after WUMT checks for updates, before closing WUMT. If you ran the Configurator to "leave
- the Windows Update Service running at all times" you can ignore this note as the store will
- work at any time.
- *******************************************************************
- :start
- :::::::::::::::::::::::::::::::::::::::::
- :: Automatically check & get admin rights
- :::::::::::::::::::::::::::::::::::::::::
- :: ECHO.
- :: ECHO =============================
- :: ECHO Running Admin shell
- :: ECHO =============================
- :: Check Privileges
- :: Get Privileges
- :: and
- :: Invoke UAC for Privilege Escalation
- :: Notify if error escalating
- :: and prevent looping if escalation fails
- ::::::::::::::::::::::::::::
- set "params=Problem_with_elevating_UAC_for_Administrator_Privileges"&if exist "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs"
- fsutil dirty query %systemdrive% >nul 2>&1 && goto :GotPrivileges
- :: The following test is to avoid infinite looping if elevating UAC for Administrator Privileges failed
- If "%1"=="%params%" (echo Elevating UAC for Administrator Privileges failed&echo Right click on the script and select 'Run as administrator'&echo Press any key to exit...&pause>nul 2>&1&exit)
- cmd /u /c echo Set UAC = CreateObject^("Shell.Application"^) : UAC.ShellExecute "%~0", "%params%", "", "runas", 1 > "%temp%\getadmin.vbs"&cscript //nologo "%temp%\getadmin.vbs"&exit
- :GotPrivileges
- ::::::::::::::::::::::::::::
- ::START
- ::Uninstall and remove Windows 10 Update assistant.
- ::Disable Windows Update Service until script menu screen.
- ::Reset (in case of wrong Permissions), remove Permissions from and Disable UsoClient.exe,
- ::WaaSMedic.exe, WaasMedicSvc.dll, WaaSMedicPS.dll, WaaSAssessment.dll, MusNotificationUx.exe, and SIHClient.exe.
- ::Kill remsh.exe if it's running.
- ::Rename the folder %ProgramFiles%\rempl to %ProgramFiles%\rempl-backup if it exists.
- ::Install wub_task (prevents Windows Update service from starting after installing updates and rebooting).
- ::Enable and start the Windows Update Service (wuauserv).
- ::Run the correct version of WUMT for your architecture.
- ::Start WUMT in "auto-check for updates" mode.
- ::After updates are completed and WUMT is closed and/or the "reboot"
- ::button in WUMT is pressed, silently run wub.exe and disable and stop wuauserv
- ::::::::::::::::::::::::::::
- @echo off
- cls
- rem Get Windows OS build number
- for /f "tokens=2 delims==" %%a in ('wmic path Win32_OperatingSystem get BuildNumber /value') do (
- set /a WinBuild=%%a)
- rem Test for Windows 7
- if %winbuild% LEQ 7601 (call "%~dp0module2.cmd" & goto StartWUMT)
- if exist "%systemdrive%\Windows10Upgrade\Windows10UpgraderApp.exe" ( echo Windows 10 Update Assistant detected. Preparing to uninstall.
- echo The "Windows 10 Update Assistant has stopped working" dialog box may pop up. If so, just close it.
- echo Press a key to acknowledge this and please wait for the uninstall to finish.
- echo Script will continue after uninstall and removal is completed...
- pause > nul
- echo Uninstalling Windows 10 Update Assistant...
- %systemdrive%\Windows10Upgrade\Windows10UpgraderApp.exe /forceuninstall
- timeout /t 10 /nobreak >nul 2>&1
- del %systemroot%\UpdateAssistant\*.* /f /q >nul 2>&1
- rmdir %systemroot%\UpdateAssistant /s /q >nul 2>&1
- del %SystemDrive%\Windows10Upgrade\*.* /f /q >nul 2>&1
- rmdir %SystemDrive%\Windows10Upgrade /s /q >nul 2>&1
- cls
- echo Windows 10 Update Assistant removed.
- echo Press a key to continue...
- pause > nul )
- cls
- ::::::::::::::::::::::::::::
- echo.
- echo Please wait...
- ::::::::::::::::::::::::::::
- del %systemroot%\UpdateAssistantV2\*.* /f /q >nul 2>&1
- rmdir %systemroot%\UpdateAssistantV2 /s /q >nul 2>&1
- ::::::::::::::::::::::::::::
- ::Check if update service is running or not and then delete correct file
- sc query | find /i "wuauserv" > nul & if errorlevel 1 (if exist "%~dp0wub.exe" del "%~dp0wub.exe-backup" /f /q >nul 2>&1
- ) else (
- if exist "%~dp0wub.exe-backup" del "%~dp0wub.exe" /f /q >nul 2>&1)
- ::::::::::::::::::::::::::::
- ::If somehow both files "wub.exe" and "wub.exe-backup" exist after the previous check, delete "wub.exe-backup"
- if exist "%~dp0wub.exe" if exist "%~dp0wub.exe-backup" del "%~dp0wub.exe-backup" /f /q >nul 2>&1
- ::::::::::::::::::::::::::::
- "%~dp0wub.exe" /d /p >nul 2>&1
- ::::::::::::::::::::::::::::
- ::Remove ability for the following files to be executed
- takeown /f "%systemroot%\System32\UsoClient.exe" /a >nul 2>&1
- icacls "%systemroot%\System32\UsoClient.exe" /reset >nul 2>&1
- icacls "%systemroot%\System32\UsoClient.exe" /inheritance:r /remove *S-1-5-32-544 *S-1-5-11 *S-1-5-32-545 *S-1-5-18 >nul 2>&1
- ::::::::::::::::::::::::::::
- takeown /f "%systemroot%\System32\WaaSMedic.exe" /a >nul 2>&1
- icacls "%systemroot%\System32\WaaSMedic.exe" /reset >nul 2>&1
- icacls "%systemroot%\System32\WaaSMedic.exe" /inheritance:r /remove *S-1-5-32-544 *S-1-5-11 *S-1-5-32-545 *S-1-5-18 >nul 2>&1
- ::::::::::::::::::::::::::::
- takeown /f "%systemroot%\System32\WaasMedicSvc.dll" /a >nul 2>&1
- icacls "%systemroot%\System32\WaasMedicSvc.dll" /reset >nul 2>&1
- icacls "%systemroot%\System32\WaasMedicSvc.dll" /inheritance:r /remove *S-1-5-32-544 *S-1-5-11 *S-1-5-32-545 *S-1-5-18 >nul 2>&1
- ::::::::::::::::::::::::::::
- takeown /f "%systemroot%\System32\WaaSMedicPS.dll" /a >nul 2>&1
- icacls "%systemroot%\System32\WaaSMedicPS.dll" /reset >nul 2>&1
- icacls "%systemroot%\System32\WaaSMedicPS.dll" /inheritance:r /remove *S-1-5-32-544 *S-1-5-11 *S-1-5-32-545 *S-1-5-18 >nul 2>&1
- ::::::::::::::::::::::::::::
- takeown /f "%systemroot%\System32\WaaSAssessment.dll" /a >nul 2>&1
- icacls "%systemroot%\System32\WaaSAssessment.dll" /reset >nul 2>&1
- icacls "%systemroot%\System32\WaaSAssessment.dll" /inheritance:r /remove *S-1-5-32-544 *S-1-5-11 *S-1-5-32-545 *S-1-5-18 >nul 2>&1
- ::::::::::::::::::::::::::::
- takeown /f "%systemroot%\System32\SIHClient.exe" /a >nul 2>&1
- icacls "%systemroot%\System32\SIHClient.exe" /reset >nul 2>&1
- icacls "%systemroot%\System32\SIHClient.exe" /inheritance:r /remove *S-1-5-32-544 *S-1-5-11 *S-1-5-32-545 *S-1-5-18 >nul 2>&1
- ::::::::::::::::::::::::::::
- takeown /f "%systemroot%\System32\MusNotificationUx.exe" /a >nul 2>&1
- icacls "%systemroot%\System32\MusNotificationUx.exe" /reset >nul 2>&1
- icacls "%systemroot%\System32\MusNotificationUx.exe" /inheritance:r /remove *S-1-5-32-544 *S-1-5-11 *S-1-5-32-545 *S-1-5-18 >nul 2>&1
- ::::::::::::::::::::::::::::
- ::Disable remsh
- taskkill /im remsh.exe /f >nul 2>&1
- if exist "%ProgramFiles%\rempl" rmdir /s /q "%ProgramFiles%\rempl-backup" >nul 2>&1
- ren "%ProgramFiles%\rempl" rempl-backup >nul 2>&1
- ::::::::::::::::::::::::::::
- ::Create automatic Windows Defender Update "WDU" task that updates Defender only if it's enabled and running.
- ::Create Windows Update Blocker "Wub_task" that sets your desired Windows Update service state at boot.
- pushd %~dp0
- cscript //nologo module.vbs >nul 2>&1
- cls
- timeout /t 1 /nobreak >nul 2>&1
- popd
- ::::::::::::::::::::::::::::
- echo ***********************************************
- echo Welcome to manual updates!
- echo Automatic updates are now turned off
- echo (unless overriden with Configurator).
- echo This script automates the update process
- echo It automatically disables a range of useless junk
- echo that bypasses windows update, such as:
- echo remsh, UsoClient, WaaSMedic, SIHClient, and Update Assistant.*
- echo Enables and starts only the Windows Update Service.
- echo Runs the Windows Update MiniTool (WUMT).
- echo After updates, stops and disables the Windows Update service.
- echo *The included uninstaller undoes script changes.*
- echo Closing WUMT at any time disables updates again;
- echo however, if WUMT is already offering updates, you
- echo need to hide them and/or install them one-by-one
- echo before closing WUMT or it may install them without
- echo asking next time. Don't change WUMT settings while
- echo running this script. If an update requires a reboot,
- echo re-run the script and just close the first screen
- echo to make sure the useless junk that forces updates
- echo stay off.
- echo Run Configurator.cmd to enable running store any time.
- echo ***********************************************
- echo. & echo Press any key to check for updates, or
- echo close this screen to cancel and leave updates turned off
- echo (unless overridden with configurator) & pause > nul
- :StartWUMT
- "%~dp0wub.exe" /e
- :: Check OS and run correct version of WUMT
- for /f "tokens=2 delims==" %%a in ('wmic cpu get AddressWidth /value') do (set arch=%%a)
- IF %arch% == 32 (set "wumt=%~dp0wumt_x86.exe") else (set "wumt=%~dp0wumt_x64.exe")
- Start "" "%wumt%" -update "-onclose %~dp0wub.exe /d /p"
Advertisement
Add Comment
Please, Sign In to add comment