pf100

v2.6.0Uninstaller_undo-all-script-changes.cmd

Mar 12th, 2019
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.18 KB | None | 0 0
  1. @echo off
  2. mode con cols=85 lines=20
  3. Color 1F
  4. Title Windows 10 Update Control Wrapper Script 2.6.0 uninstaller
  5. ::Elevate permissions
  6. set "params=Problem_with_elevating_UAC_for_Administrator_Privileges"&if exist "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs"
  7. fsutil dirty query %systemdrive% >nul 2>&1 && goto :GotPrivileges
  8. :: The following test is to avoid infinite looping if elevating UAC for Administrator Privileges failed
  9. 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)
  10. cmd /u /c echo Set UAC = CreateObject^("Shell.Application"^) : UAC.ShellExecute "%~0", "%params%", "", "runas", 1 > "%temp%\getadmin.vbs"&cscript //nologo "%temp%\getadmin.vbs"&exit
  11. :GotPrivileges
  12. ::Start
  13. cd /d "%~dp0"
  14. echo. & echo ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ WUMT Wrapper Script Uninstaller
  15. echo. & echo ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ If you continue, and have no other method of controlling
  16. echo ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ updates, UPDATES MAY START RIGHT AWAY.
  17. echo. & echo ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ DISABLE THE INTERNET FIRST? Press (Y)es or(N).
  18. echo. & echo ^ If you select (Y), "Network Connections" in the Control Panel will open so you can
  19. echo ^ temporarily disable your Internet connection.
  20. echo. & echo ^ Whether you select (Y) or (N), the next script window will stay open allowing you
  21. echo ^ to fully uninstall the script and all associated changes that were made when you
  22. echo ^ first ran the script.
  23. CHOICE /C YN /M "Your choice?:" >nul 2>&1
  24. if %errorlevel%==2 (goto nodisablenet)
  25. %systemroot%\System32\control.exe ncpa.cpl
  26. :nodisablenet
  27. cls
  28. echo. & echo. & echo. & echo. & echo. & echo. & echo.
  29. echo ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I have to ask if you're really sure?
  30. echo ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ Press (Y)es to uninstall, (N)o or
  31. echo ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ close window to cancel...
  32. CHOICE /C YN /M "Your choice?:" >nul 2>&1
  33. if %errorlevel%==2 (exit)
  34. cls
  35. set s32=%systemroot%\System32
  36. ::::::::::::::::::::::::::::::::::
  37. ::restore rempl folder permissions
  38. takeown /f "%ProgramFiles%\rempl" /a >nul 2>&1
  39. icacls "%ProgramFiles%\rempl" /reset >nul 2>&1
  40. icacls "%ProgramFiles%\rempl" /setowner *S-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464 >nul 2>&1
  41. ::::::::::::::::::::::::::::::::::
  42. ::restore rempl file permissions
  43. for %%? in ("%ProgramFiles%\rempl\*") do (
  44. takeown /f "%%?" /a >nul 2>&1
  45. icacls "%%?" /q /c /reset >nul 2>&1
  46. icacls "%%?" /setowner *S-1-5-18 >nul 2>&1
  47. )
  48. ::::::::::::::::::::::::::::::::::
  49. schtasks /delete /tn WDU >nul /f 2>&1
  50. schtasks /delete /tn Wub_task /f >nul 2>&1
  51. schtasks /Delete /Tn \Microsoft\WuWrapperScript\WDU /f >nul 2>&1
  52. schtasks /Delete /Tn \Microsoft\WuWrapperScript\Wub_task /f >nul 2>&1
  53. rmdir %SystemDrive%\Windows\System32\Tasks\Microsoft\WuWrapperScript /s /q >nul 2>&1
  54. rem timeout /t 3 >nul 2>&1
  55. nsudocx64 -ShowWindowMode:Hide -Wait -U:T -P:E reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\Microsoft\WuWrapperScript" /f >nul 2>&1
  56. ::::::::::::::::::::::::::::::::::
  57. ::Restore Language Components Installer tasks to defaults
  58. takeown /f "%systemroot%\System32\Tasks\Microsoft\Windows\LanguageComponentsInstaller\*" /a >nul 2>&1
  59. icacls "%systemroot%\System32\Tasks\Microsoft\Windows\LanguageComponentsInstaller\*" /q /c /t /reset >nul 2>&1
  60. for %%? in ("%systemroot%\System32\Tasks\Microsoft\Windows\LanguageComponentsInstaller\*") do schtasks /change /tn "Microsoft\Windows\LanguageComponentsInstaller\%%~nx?" /enable >nul 2>&1
  61. schtasks /change /tn "Microsoft\Windows\LanguageComponentsInstaller\Uninstallation" /disable >nul 2>&1
  62. icacls "%systemroot%\System32\Tasks\Microsoft\Windows\LanguageComponentsInstaller\*" /setowner *S-1-5-18 >nul 2>&1
  63. ::::::::::::::::::::::::::::::::::
  64. ::Restore Windows Update tasks to defaults
  65. takeown /f "%systemroot%\System32\Tasks\Microsoft\Windows\WindowsUpdate\*" /a >nul 2>&1
  66. icacls "%systemroot%\System32\Tasks\Microsoft\Windows\WindowsUpdate\*" /q /c /t /reset >nul 2>&1
  67. for %%? in ("%systemroot%\System32\Tasks\Microsoft\Windows\WindowsUpdate\*") do schtasks /change /tn "Microsoft\Windows\WindowsUpdate\%%~nx?" /enable >nul 2>&1
  68. icacls "%systemroot%\System32\Tasks\Microsoft\Windows\WindowsUpdate\*" /setowner *S-1-5-18 >nul 2>&1
  69. ::::::::::::::::::::::::::::::::::
  70. ::Restore default permissions to Update Hijacker files disabled by script
  71. set s32list=EOSNotify.exe WaaSMedic.exe WaasMedicSvc.dll WaaSMedicPS.dll WaaSAssessment.dll UsoClient.exe
  72. set s32list=%s32list% SIHClient.exe MusNotificationUx.exe MusNotification.exe osrss.dll
  73. ::If "s32list" files were renamed by script, restore original file names
  74. for %%# in (%s32list%) do (
  75. ren "%s32%\%%#"-backup "%%#" >nul 2>&1
  76. if exist "%s32%\%%#" del "%s32%\%%#"-backup /f /q >nul 2>&1
  77. )
  78. ::Now restore default permissions for Update Hijacker files
  79. for %%# in (%s32list%) do (
  80. takeown /f "%s32%\%%#" /a >nul 2>&1
  81. icacls "%s32%\%%#" /reset >nul 2>&1
  82. icacls "%s32%\%%#" /setowner *S-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464 >nul 2>&1
  83. )
  84. ::restore Update Assistant folder permissions
  85. takeown /f "%systemroot%\UpdateAssistant" /a >nul 2>&1
  86. icacls "%systemroot%\UpdateAssistant" /reset >nul 2>&1
  87. icacls "%systemroot%\UpdateAssistant" /setowner *S-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464 >nul 2>&1
  88. takeown /f "%systemroot%\UpdateAssistantV2" /a >nul 2>&1
  89. icacls "%systemroot%\UpdateAssistantV2" /reset >nul 2>&1
  90. icacls "%systemroot%\UpdateAssistantV2" /setowner *S-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464 >nul 2>&1
  91. ::::::::::::::::::::::::::::::::::
  92. "%~dp0wub.exe" /e >nul 2>&1
  93. timeout /t 3 >nul 2>&1
  94. cls
  95. if not exist "%~dp0unins000.exe" (
  96. echo. & echo. & echo. & echo. & echo. & echo.
  97. echo ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ::::::::::::::::::::::::::::::::::::
  98. echo ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ : WUMT Wrapper Script uninstalled. :
  99. echo ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ : Press any key to exit... :
  100. echo ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ::::::::::::::::::::::::::::::::::::
  101. pause > nul
  102. exit
  103. )
  104. "%~dp0unins000.exe" /silent /norestart
Advertisement
Add Comment
Please, Sign In to add comment