Advertisement
pf100

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

Sep 25th, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.02 KB | None | 0 0
  1. @echo off
  2. mode con cols=85 lines=12
  3. Color 1F
  4. Title WUMT Wrapper Script 2.5.3 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. rem echo ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
  17. echo. & echo ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ Do you want to open "network connections" now so you can
  18. echo ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ disable the internet first? If yes press (Y) (return to
  19. echo ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ this window after you're done), if no press (N).
  20. echo ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ Press (Y)es or (N)o
  21. CHOICE /C YN /M "Your choice?:" >nul 2>&1
  22. if %errorlevel%==2 (goto nodisablenet)
  23. %systemroot%\System32\control.exe ncpa.cpl
  24. :nodisablenet
  25. cls
  26. echo. & echo. &
  27. echo. & echo ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I have to ask if you're really sure?
  28. echo ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ Press (Y)es to uninstall, (N)o or
  29. echo ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ close window to cancel...
  30. CHOICE /C YN /M "Your choice?:" >nul 2>&1
  31. if %errorlevel%==2 (exit)
  32. cls
  33. for %%? in ("%ProgramFiles%\rempl\*") do (
  34. takeown /f "%%?" /a >nul 2>&1
  35. icacls "%%?" /q /c /reset >nul 2>&1
  36. icacls "%%?" /setowner *S-1-5-18 >nul 2>&1
  37. )
  38. ren "%~dp0wub.exe-backup" wub.exe >nul 2>&1
  39. schtasks /delete /tn "wub_task" /f >nul 2>&1
  40. schtasks /delete /tn "WDU" /f >nul 2>&1
  41. del "%~dp0WDU.cmd" /f /q >nul 2>&1
  42. ::::::::::::::::::::::::::::::::::
  43. ::Restore Windows Update tasks to defaults
  44. takeown /f "%systemroot%\System32\Tasks\Microsoft\Windows\WindowsUpdate\*" /a >nul 2>&1
  45. icacls "%systemroot%\System32\Tasks\Microsoft\Windows\WindowsUpdate\*" /q /c /t /reset >nul 2>&1
  46. for %%? in ("%systemroot%\System32\Tasks\Microsoft\Windows\WindowsUpdate\*") do schtasks /change /tn "Microsoft\Windows\WindowsUpdate\%%~nx?" /enable >nul 2>&1
  47. icacls "%systemroot%\System32\Tasks\Microsoft\Windows\WindowsUpdate\*" /setowner *S-1-5-18 >nul 2>&1
  48. ::::::::::::::::::::::::::::::::::
  49. ::Restore default permissions to Update Hijacker files disabled by script
  50. set s32list=EOSNotify.exe WaaSMedic.exe WaasMedicSvc.dll WaaSMedicPS.dll WaaSAssessment.dll UsoClient.exe
  51. set s32list=%s32list% SIHClient.exe MusNotificationUx.exe MusNotification.exe osrss.dll
  52. set s32=%systemroot%\System32
  53. ::If "s32list" files were renamed by script, restore original file names
  54. for %%# in (%s32list%) do (
  55. ren "%s32%\%%#"-backup "%%#" >nul 2>&1
  56. if exist "%s32%\%%#" del "%s32%\%%#"-backup /f /q >nul 2>&1
  57. )
  58. ::Now restore default permissions for Update Hijacker files
  59. for %%# in (%s32list%) do (
  60. takeown /f "%s32%\%%#" /a >nul 2>&1
  61. icacls "%s32%\%%#" /reset >nul 2>&1
  62. icacls "%s32%\%%#" /setowner *S-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464 >nul 2>&1
  63. )
  64. ::::::::::::::::::::::::::::::::::
  65. "%~dp0wub.exe" /e >nul 2>&1
  66. cls
  67. if not exist "%~dp0unins000.exe" (
  68. echo.
  69. echo.
  70. echo.
  71. echo ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ::::::::::::::::::::::::::::::::::::
  72. echo ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ : WUMT Wrapper Script uninstalled. :
  73. echo ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ : Press any key to exit... :
  74. echo ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ::::::::::::::::::::::::::::::::::::
  75. pause > nul
  76. exit
  77. )
  78. "%~dp0unins000.exe" /silent /norestart
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement