Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- mode con cols=82 lines=30
- Title WUMT Wrapper Script 2.5.3
- 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.
- ******************************************************************
- Don't move this script to another folder without running it again or the tasks won't work!
- Script supports only English and other Western European language characters in path.
- See https://msdn.microsoft.com/en-us/library/cc195054.aspx for more information about allowed characters.
- 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: http://sordum.org/files/windows-update-blocker/old/Wub_v1.0.zip
- Only use Windows Update Blocker v1.0 with this script, NOT v1.1!
- *******************************************************************
- How it works: The script first checks if the OS is Windows 8.1 or older and if so
- it notifies the user, then exits. Windows 10 only!
- This script creates a smart Windows Defender Update task "WDU" that updates Windows
- Defender every 2 hours if it's running and enabled, and doesn't update it if it's not
- running and disabled, saving resources; auto-elevates, uninstalls and removes the
- Windows 10 Update Assistant, disables everything in the %programfiles%\rempl folder, resets and
- removes permissions from and disables these Update Hijackers:
- remsh.exe
- osrss.dll
- UsoClient.exe
- WaaSMedic.exe
- WaasMedicSvc.dll
- WaaSMedicPS.dll
- WaaSAssessment.dll
- MusNotification.exe
- MusNotificationUx.exe
- SIHClient.exe
- disables all WindowsUpdate tasks except for "Automatic App Update" task which can only run
- if the windows update service is enabled with the Configurator.
- 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, installs "WDU" Windows Defender Update task that runs every 2 hours (but doesn't update
- Defender if Defender is disabled), 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 "WDU" and "wub_task" tasks, deletes the WDU.cmd
- file used by WDU task, restores the rempl folder, resets Update Hijacker permissions to how they
- were originally, renables "WindowsUpdate" tasks, and turns off wub (if enabled) which turns the windows update service on automatic
- again, undoing everything done by the script. If you uninstall after having used the installer the
- script files are removed also.
- *******************************************************************
- Configurator leaves the Update Hijackers disabled, but gives you the option of turning on the windows
- update service temporarily to use the Store or any other operation that requires the windows update
- service, such as some DISM operations, installing dotNet 3.5, App Updates, etc.
- *******************************************************************
- :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
- ::::::::::::::::::::::::::::
- ::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 "Update Hijackers"
- ::Install wub_task (prevents Windows Update service from starting after installing updates and rebooting).
- ::Install "WDU" task that only updates Defender if it's enabled. Otherwise it doesn't do anything.
- ::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
- ::Test for Windows versions below Windows 10 and if so inform user, then exit...
- ::Get Windows OS build number
- for /f "tokens=2 delims==" %%a in ('wmic path Win32_OperatingSystem get BuildNumber /value') do (
- set /a WinBuild=%%a
- )
- if %winbuild% LEQ 9600 (
- cls
- echo.&echo This is not Windows 10. Press a key to exit...
- pause > nul
- exit
- )
- ::Remove Update Assistant
- 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)
- del %SystemDrive%\Windows10Upgrade\*.* /f /q >nul 2>&1
- rmdir %SystemDrive%\Windows10Upgrade /s /q >nul 2>&1
- del %systemroot%\UpdateAssistant\*.* /f /q >nul 2>&1
- rmdir %systemroot%\UpdateAssistant /s /q >nul 2>&1
- del %systemroot%\UpdateAssistantV2\*.* /f /q >nul 2>&1
- rmdir %systemroot%\UpdateAssistantV2 /s /q >nul 2>&1
- ::::::::::::::::::::::::::::
- echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.
- echo. & echo ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ Initializing script...
- ::::::::::::::::::::::::::::
- ::In case new script is copied over old script while wub.exe-backup exists, then wub.exe would exist too,
- ::so check if windows update service is disabled or not and then correctly delete either wub.exe or wub.exe-backup.
- Reg query "HKLM\SYSTEM\CurrentControlSet\Services\wuauserv" /v "Start" | find "4" >nul 2>&1
- IF %ERRORLEVEL% == 0 (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)
- ::::::::::::::::::::::::::::
- :: Disable and lock all Windows Update tasks except for "Automatic App Update" and prevent them from being enabled.
- takeown /f "%systemroot%\System32\Tasks\Microsoft\Windows\WindowsUpdate\*" /a >nul 2>&1
- icacls "%systemroot%\System32\Tasks\Microsoft\Windows\WindowsUpdate\*" /q /c /t /reset >nul 2>&1
- for %%? in ("%systemroot%\System32\Tasks\Microsoft\Windows\WindowsUpdate\*") do schtasks /change /tn "Microsoft\Windows\WindowsUpdate\%%~nx?" /disable >nul 2>&1
- schtasks /change /tn "\Microsoft\Windows\WindowsUpdate\Automatic App Update" /enable >nul 2>&1
- icacls "%systemroot%\System32\Tasks\Microsoft\Windows\WindowsUpdate\*" /inheritance:r /remove *S-1-5-32-544 *S-1-5-11 *S-1-5-32-545 *S-1-5-18 >nul 2>&1
- icacls "%systemroot%\System32\Tasks\Microsoft\Windows\WindowsUpdate\Automatic App Update" /reset >nul 2>&1
- icacls "%systemroot%\System32\Tasks\Microsoft\Windows\WindowsUpdate\Automatic App Update" /setowner *S-1-5-18 >nul 2>&1
- ::::::::::::::::::::::::::::
- ::Set list (s32list) of update hijacker files to be disabled, then disable everything in the list.
- set s32list=EOSNotify.exe WaaSMedic.exe WaasMedicSvc.dll WaaSMedicPS.dll WaaSAssessment.dll UsoClient.exe
- set s32list=%s32list% SIHClient.exe MusNotificationUx.exe MusNotification.exe osrss.dll
- set s32=%systemroot%\System32
- for %%# in (%s32list%) do (
- takeown /f "%s32%\%%#" /a >nul 2>&1
- icacls "%s32%\%%#" /reset >nul 2>&1
- icacls "%s32%\%%#" /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 update service.
- ren "%~dp0wub.exe-backup" wub.exe >nul 2>&1
- "%~dp0wub.exe" /d /p >nul 2>&1
- ::::::::::::::::::::::::::::
- ::Disable rempl
- for %%? in ("%ProgramFiles%\rempl\*") do (
- takeown /f "%%?" /a >nul 2>&1
- icacls "%%?" /reset >nul 2>&1
- icacls "%%?" /inheritance:r /remove *S-1-5-32-544 *S-1-5-11 *S-1-5-32-545 *S-1-5-18 >nul 2>&1
- )
- ::::::::::::::::::::::::::::
- :splash
- cls
- echo **********************************************************************************
- echo ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ Welcome to manual updates!
- echo.&echo ^ ^ ^ ^ ^ ^ ^ Automatic updates and "update hijackers" are now disabled.
- echo ^ ^ ^ ^ ^ ^ ^ Run script again after you install updates at least until
- echo ^ ^ ^ ^ ^ ^ ^ this screen appears to kill any newly installed update hijackers!
- echo ^ ^ ^ ^ ^ ^ ^ You may close this screen now with "Alt-F4" or click "X" in window.
- echo.
- echo ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ [44;93mPress any key to continue to Configurator.[44;97m
- echo.&echo **********************************************************************************
- echo Automatic updates and "update hijackers" are now turned off. This script automates
- echo the update process. It automatically disables a range of "Update Hijackers" such
- echo as: osrss, rempl, Uso, WaaS, SIH, and Update Assistant; enables and starts only
- echo the Windows Update Service, then runs the Windows Update MiniTool (WUMT). After
- echo updates, stops and disables the Windows Update service. The included uninstaller
- echo undoes script changes. Closing WUMT at any time disables updates again; however,
- echo if WUMT is already offering updates, you need to hide them and/or install them
- echo before closing WUMT or it may install them without asking next time. Don't change
- echo WUMT settings while running this script. If an update requires a reboot, re-run
- echo the script after the reboot and just close this screen to make sure the "Update
- echo Hijackers" stay off. Enable update service in Configurator in script to use the
- echo Store. Script will automatically disable Windows Update after update check and
- echo WUMT is closed. So enable updates, use store, then either 1) disable updates or
- echo 2) continue script to check for updates and update service will be disabled.
- echo If you move this script to another folder run it again so the tasks will work!
- echo **********************************************************************************
- echo.&echo ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ [44;93mPress any key to continue to Configurator.[44;97m
- pause > nul
- ::::::::::::::::::::::::::::
- ::Windows Update Service Configurator
- cls
- echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.
- echo. & echo ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ Initializing Configurator...
- ::disable windows update service except when wumt is run.
- :wudisable
- ren "%~dp0wub.exe-backup" wub.exe >nul 2>&1
- timeout /t 2 /nobreak >nul 2>&1
- "%~dp0wub.exe" /d /p >nul 2>&1
- timeout /t 2 /nobreak >nul 2>&1
- cls
- echo.&echo.&echo.
- echo ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- echo ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ :WUMT Wrapper Script Windows Update Service Configurator:
- echo ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::: &echo.&echo.
- echo ^ ^ ^ ^ ^ ^ [44;93m---^>^>^> Windows Update Service is DISABLED and stopped ^(default^) ^<^<^<---[44;97m
- echo.&echo.&echo [E]nable Update Service temporarily to use Windows Store.
- echo. & echo [C]ontinue script to run WUMT and check for Windows Updates.
- echo. & echo [Q]uit script, or "Alt + F4", or close window, if you're just verifying or are
- echo ^ ^ ^ finished changing the update service setting. It stays how it's set above.
- echo.&echo.&echo ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ Please select [E], [C], or [Q] (or close window)
- CHOICE /C ECQ /M "Your choice?:" >nul 2>&1
- if %errorlevel%==3 (exit)
- if %errorlevel%==2 (goto StartWUMT)
- cls
- echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.
- echo.&echo ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ Please wait while Windows Update Service is enabled.
- echo.&echo ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ This will take a few seconds...
- timeout /t 2 /nobreak >nul 2>&1
- ::enable windows update service
- :wuenable
- ren "%~dp0wub.exe-backup" wub.exe >nul 2>&1
- timeout /t 2 /nobreak >nul 2>&1
- "%~dp0wub.exe" /e >nul 2>&1
- timeout /t 2 /nobreak >nul 2>&1
- "%~dp0wub.exe" /e >nul 2>&1
- timeout /t 2 /nobreak >nul 2>&1
- ren "%~dp0wub.exe" wub.exe-backup >nul 2>&1
- timeout /t 2 /nobreak >nul 2>&1
- cls
- echo.&echo.&echo.
- echo ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- echo ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ :WUMT Wrapper Script Windows Update Service Configurator:
- echo ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::: &echo.&echo.
- echo ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ [44;93m---^>^>^> Windows Update Service is ENABLED ^(for Store^) ^<^<^<---[44;97m
- echo.&echo.&echo [D]isable Update Service and only allow to run during script updates (default).
- echo.&echo [C]ontinue script to run WUMT and check for Windows Updates. Update service will
- echo ^ ^ ^ ^ ^ ^ be disabled automatically after update check and WUMT is closed.
- echo.&echo ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ Please select [D] or [C]
- echo.&echo.&echo ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- echo ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ [44;93m:Don't close this window or update service will stay on!!! :[44;97m
- echo ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ [44;93m: ^ Don't worry. Just run the script again to turn it off. ^ :[44;97m
- echo ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- CHOICE /C DC /M "Your choice?:" >nul 2>&1
- if %errorlevel%==2 (goto StartWUMT)
- if %errorlevel%==1 (
- cls
- echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.
- echo. & echo ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ Please wait while Windows Update Service is disabled.
- echo. & echo ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ This will take a few seconds...
- timeout /t 2 /nobreak >nul 2>&1
- goto wudisable
- )
- ::::::::::::::::::::::::::::
- :StartWUMT
- ::::::::::::::::::::::::::::
- ::
- :: Create automatic Windows Defender Update "WDU" task that updates Defender only if it's enabled and running.
- set "Task_Name=WDU"
- ::
- :: Create WDU.cmd
- ::
- (
- echo SETLOCAL EnableDelayedExpansion
- echo ::Allow only WDU task to run this file::
- echo whoami /user /nh ^| find /i "S-1-5-18" ^|^| exit
- echo cd /d "%%~dp0"
- echo ::Wait 5 minutes to prevent resource hogging after reboot with missed update::
- echo timeout /t 300
- echo ::If WUMT or WuMgr are running, cancel Defender update and exit. If not, continue::
- echo tasklist ^| findstr /irc:"wumt_x.*exe"
- echo if %%errorlevel%% equ 0 goto skipdefenderupdate
- echo tasklist ^| findstr "wumgr.exe"
- echo if %%errorlevel%% equ 0 goto skipdefenderupdate
- echo ::If Windows Defender is running, update it. If not, cancel Defender update and exit::
- echo sc query ^| find /i "windefend"
- echo if %%errorlevel%% equ 1 goto skipdefenderupdate
- echo ::Enable Windows Update service and update Defender, then disable Update Service::
- echo if not exist wub.exe-backup ^(wub.exe /e^)
- echo timeout /t 10
- echo "%%ProgramFiles%%\Windows Defender\MpCmdRun.exe" -SignatureUpdate
- echo if not exist wub.exe-backup ^(wub.exe /d /p^)
- echo goto defenderupdated
- echo :skipdefenderupdate
- echo set errorlevel=1
- echo :defenderupdated
- echo exit /b %%errorlevel%%
- )>"%~dp0wdu.cmd"
- ::
- :: Create WDU.xml
- ::
- (
- echo ^<?xml version="1.0" encoding="UTF-16"?^>
- echo ^<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task"^>
- echo ^<RegistrationInfo^>
- echo ^<Date^>2016-02-18T08:29:39^</Date^>
- echo ^<Author^>pf100\rpo^</Author^>
- echo ^<URI^>WindowsDefenderUpdate^</URI^>
- echo ^</RegistrationInfo^>
- echo ^<Triggers^>
- echo ^<CalendarTrigger^>
- echo ^<Repetition^>
- echo ^<Interval^>PT6H^</Interval^>
- echo ^<StopAtDurationEnd^>false^</StopAtDurationEnd^>
- echo ^</Repetition^>
- echo ^<StartBoundary^>2016-05-12T00:01:00.0^</StartBoundary^>
- echo ^<Enabled^>true^</Enabled^>
- echo ^<ScheduleByDay^>
- echo ^<DaysInterval^>1^</DaysInterval^>
- echo ^</ScheduleByDay^>
- echo ^</CalendarTrigger^>
- echo ^</Triggers^>
- echo ^<Principals^>
- echo ^<Principal id="Author"^>
- echo ^<UserId^>S-1-5-18^</UserId^>
- echo ^<RunLevel^>HighestAvailable^</RunLevel^>
- echo ^</Principal^>
- echo ^</Principals^>
- echo ^<Settings^>
- echo ^<MultipleInstancesPolicy^>IgnoreNew^</MultipleInstancesPolicy^>
- echo ^<DisallowStartIfOnBatteries^>false^</DisallowStartIfOnBatteries^>
- echo ^<StopIfGoingOnBatteries^>false^</StopIfGoingOnBatteries^>
- echo ^<AllowHardTerminate^>true^</AllowHardTerminate^>
- echo ^<StartWhenAvailable^>true^</StartWhenAvailable^>
- echo ^<RunOnlyIfNetworkAvailable^>true^</RunOnlyIfNetworkAvailable^>
- echo ^<IdleSettings^>
- echo ^<StopOnIdleEnd^>false^</StopOnIdleEnd^>
- echo ^<RestartOnIdle^>false^</RestartOnIdle^>
- echo ^</IdleSettings^>
- echo ^<AllowStartOnDemand^>true^</AllowStartOnDemand^>
- echo ^<Enabled^>true^</Enabled^>
- echo ^<Hidden^>false^</Hidden^>
- echo ^<RunOnlyIfIdle^>false^</RunOnlyIfIdle^>
- echo ^<WakeToRun^>false^</WakeToRun^>
- echo ^<ExecutionTimeLimit^>PT72H^</ExecutionTimeLimit^>
- echo ^<Priority^>7^</Priority^>
- echo ^</Settings^>
- echo ^<Actions Context="Author"^>
- echo ^<Exec^>
- echo ^<Command^>"%~dps0WDU.cmd"^</Command^>
- echo ^</Exec^>
- echo ^</Actions^>
- echo ^</Task^>
- ) >"%~dp0%Task_Name%.xml"
- ::
- :: Creating Windows Defender Update auto renewal task
- ::
- schtasks /delete /tn "%Task_Name%" /f 1>nul 2>nul
- schtasks /query /fo list 2>nul | findstr /i "%Task_Name%" 1>nul || (
- schtasks /create /tn "%Task_Name%" /ru "SYSTEM" /xml "%~dp0%Task_Name%.xml" >nul 2>&1 || (
- echo.&echo Creating Windows Defender Update %Task_Name% task errored.& echo Press any key to exit... & pause > nul &exit)
- del /f /q "%~dp0%Task_Name%.xml" >nul 2>&1)
- ::
- :: Create Windows Update Blocker "Wub_task" that sets your desired Windows Update service state at boot.
- ::
- :: Create Wub_task
- ::
- set "Task_Name=Wub_task"
- ::
- (
- echo ^<?xml version="1.0" encoding="UTF-16"?^>
- echo ^<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task"^>
- echo ^<RegistrationInfo^>
- echo ^<Date^>2016-02-18T08:29:39^</Date^>
- echo ^<Author^>pf100\rpo^</Author^>
- echo ^<URI^>wub_task^</URI^>
- echo ^</RegistrationInfo^>
- echo ^<Triggers^>
- echo ^<BootTrigger^>
- echo ^<StartBoundary^>2016-02-18T08:29:00^</StartBoundary^>
- echo ^<Enabled^>true^</Enabled^>
- echo ^</BootTrigger^>
- echo ^<LogonTrigger^>
- echo ^<Enabled^>true^</Enabled^>
- echo ^</LogonTrigger^>
- echo ^</Triggers^>
- echo ^<Principals^>
- echo ^<Principal id="Author"^>
- echo ^<UserId^>S-1-5-18^</UserId^>
- echo ^<RunLevel^>HighestAvailable^</RunLevel^>
- echo ^</Principal^>
- echo ^</Principals^>
- echo ^<Settings^>
- echo ^<MultipleInstancesPolicy^>IgnoreNew^</MultipleInstancesPolicy^>
- echo ^<DisallowStartIfOnBatteries^>false^</DisallowStartIfOnBatteries^>
- echo ^<StopIfGoingOnBatteries^>false^</StopIfGoingOnBatteries^>
- echo ^<AllowHardTerminate^>true^</AllowHardTerminate^>
- echo ^<StartWhenAvailable^>true^</StartWhenAvailable^>
- echo ^<RunOnlyIfNetworkAvailable^>false^</RunOnlyIfNetworkAvailable^>
- echo ^<IdleSettings^>
- echo ^<StopOnIdleEnd^>false^</StopOnIdleEnd^>
- echo ^<RestartOnIdle^>false^</RestartOnIdle^>
- echo ^</IdleSettings^>
- echo ^<AllowStartOnDemand^>true^</AllowStartOnDemand^>
- echo ^<Enabled^>true^</Enabled^>
- echo ^<Hidden^>false^</Hidden^>
- echo ^<RunOnlyIfIdle^>false^</RunOnlyIfIdle^>
- echo ^<WakeToRun^>false^</WakeToRun^>
- echo ^<ExecutionTimeLimit^>PT72H^</ExecutionTimeLimit^>
- echo ^<Priority^>7^</Priority^>
- echo ^</Settings^>
- echo ^<Actions Context="Author"^>
- echo ^<Exec^>
- echo ^<Command^>"%~dps0Wub.exe"^</Command^>
- echo ^<Arguments^>/d /p^</Arguments^>
- echo ^</Exec^>
- echo ^</Actions^>
- echo ^</Task^>
- )>"%~dp0%Task_Name%.xml"
- ::
- :: Creating Windows Update Blocker auto renewal task
- ::
- schtasks /delete /tn "%Task_Name%" /f 1>nul 2>nul
- schtasks /query /fo list 2>nul | findstr /i "%Task_Name%" 1>nul || (
- schtasks /create /tn "%Task_Name%" /ru "SYSTEM" /xml "%~dp0%Task_Name%.xml" >nul 2>&1 || (
- echo.&Creating Windows Update Blocker Auto-Renewal %Task_Name% task errored.& echo Press any key to exit... & pause > nul &exit)
- del /f /q "%~dp0%Task_Name%.xml" >nul 2>&1)
- ::::::::::::::::::::::::::::
- (
- echo if exist "%%~dp0wub.exe-backup" ren "%%~dp0wub.exe-backup" wub.exe
- echo "%%~dp0wub.exe" /d /p
- echo del "%%~dp0close.cmd" ^& exit
- )>"%~dp0close.cmd"
- "%~dp0wub.exe" /e >nul 2>&1
- :: 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 %~dp0close.cmd"
- ::The following line will be be used to run Windows Update Manager (WuMgr) instead of WUMT when I replace WUMT with WuMgr
- ::IF you feel adventurous go ahead and rem out the WUMT line above, and un-rem the wumgr.exe line below to replace WUMT with WuMgr.
- rem Start "" "%~dp0wumgr.exe" -update -online 7971f918-a847-4430-9279-4a52d1efe18d -onclose "%~dp0close.cmd"
- exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement