pf100

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

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