pf100

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

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