Advertisement
Guest User

Untitled

a guest
Nov 19th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.18 KB | None | 0 0
  1. @echo off
  2.  
  3. :: BatchGotAdmin
  4. :---------------
  5. REM -> Check for permissions
  6. IF “%PROCESSOR_ARCHITECTURE%” EQU "amd64" (
  7. >nul 2>&1 "%SYSTEMROOT%\SysWOW64\cacls.exe" "%SYSTEMROOT%\SysWOW64\config\system"
  8. ) ELSE (
  9. >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
  10. )
  11.  
  12. REM -> If error flag set, we do not have admin.
  13. if ‘%errorlevel%’ NEQ ‘0’ (
  14. echo Requesting administrative privileges...
  15. goto UACPrompt
  16. ) else ( goto gotAdmin )
  17.  
  18. :UACPrompt
  19. echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
  20. set params = %*:"=""
  21. echo UAC.ShellExecute "cmd.exe", "/c ""%~s0"" %params%", "", "runas", 1 >> "%temp%\getadmin.vbs"
  22.  
  23. "%temp%\getadmin.vbs"
  24. del "%temp%\getadmin.vbs"
  25. exit /B
  26.  
  27. :gotAdmin
  28. pushd "%CD%"
  29. CD /D "%~dp0"
  30. :---------------
  31. SETLOCAL EnableDelayedExpansion
  32. for /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E# & echo on & for %%b in (1) do rem"') do (
  33. set "DEL=%%a"
  34. )
  35.  
  36. echo.
  37. echo.
  38. echo.
  39. call :ColorText 0c "Press any key to run the ST4 Super Nuke"
  40. echo.
  41. call :ColorText 0a "Warning -- This will completely obliterate ST4 from this PC"
  42. echo.
  43. echo.
  44. echo.
  45.  
  46. @pause
  47.  
  48.  
  49. echo.
  50. call :ColorText 0b "Nuking ST4 from system registry"
  51. echo.
  52.  
  53. taskkill /f /im iCueScheduler.exe
  54.  
  55. net stop "SQL Server (SQL_ICCM)"
  56.  
  57. wmic product where name="iCueScheduler" call uninstall /nointeractive
  58.  
  59. rem set __COMPAT_LAYER=RunAsInvoker
  60.  
  61. REG IMPORT "%~dp0\ST4_NUKE_W_MSSQL.reg"
  62.  
  63. echo.
  64. call :ColorText 0a "ST4 System registry entries nuked"
  65. echo.
  66. echo.
  67. echo.
  68.  
  69. pause
  70. echo.
  71. call :ColorText 0c "Please use Task Mgr to End Task on IcueScheduler before pressing any key to continue"
  72. echo.
  73. echo.
  74. call :ColorText 0a "All ICCM & BASF Color Software directories are about to be removed"
  75. echo.
  76. echo.
  77.  
  78. pause
  79. echo.
  80. echo.
  81. RMDIR /s /q "C:\Program Files (x86)\BASF\ICCM14_NA"
  82. RMDIR /s /q "C:\Program Files (x86)\BASF\ICCM14_NA_NA"
  83. RMDIR /s /q "C:\Program Files (x86)\BASF\ICCM14_NA_NA_NA"
  84. RMDIR /s /q "C:\Program Files (x86)\BASF\iCueScheduler"
  85. RMDIR /s /q "C:\ProgramData\BASF\ICCM2"
  86. RMDIR /s /q "C:\Users\Public\Desktop\BASF Color Software"
  87. RMDIR /s /q "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\BASF Color Software"
  88. RMDIR /s /q "C:\Program Files\BASF\ICCM14_NA"
  89. RMDIR /s /q "C:\Program Files\BASF\ICCM14_NA_NA"
  90. RMDIR /s /q "C:\Program Files\BASF\ICCM14_NA_NA_NA"
  91. RMDIR /s /q "C:\Program Files\BASF\iCueScheduler"
  92.  
  93. DEL /s /q "C:\Users\BASF\Desktop\SmartColor IV.lnk"
  94. DEL /s /q "C:\Users\BASF\Desktop\SmartTrak IV.lnk"
  95.  
  96. echo.
  97. call :ColorText 0c "---IF--- The system cannot find the file specified = No directory present to delete"
  98. call :ColorText 0b "---IF--- Access is denied = Files or Folders stuck in memory. Run Task Mgr to End Tasks"
  99. call :ColorText 0a "ICCM14_NA no longer present"
  100. call :ColorText 0a "ICCM14_NA_NA no longer present"
  101. call :ColorText 0a "ICCM14_NA_NA_NA no longer present"
  102. call :ColorText 0a "C:\ProgramData\BASF\ICCM2 no longer present"
  103. call :ColorText 0a "BASF Color Software no longer present on Desktop"
  104. call :ColorText 0a "BASF Color Software removed from Start Menu"
  105. call :ColorText 0a "ST4 and SCOLOR Desktop icons deleted"
  106. echo.
  107. echo.
  108. echo.
  109. pause
  110.  
  111. echo.
  112. echo.
  113. echo.
  114. call :ColorText 0b "----- ST4 Super Nuke complete!!!! -----"
  115. echo.
  116. echo.
  117. call :ColorText 0f " ---BE SURE TO UNINSTALL MS SQL 2008---"
  118. call :ColorText 0f "from Prog & Features before running a full installation of ST4"
  119. echo.
  120. echo.
  121. echo.
  122. call :ColorText 0c "Press any key to return to your regularly scheduled programming"
  123. echo.
  124. echo.
  125. call :ColorText 0e " This program will now open the SQL Uninstaller."
  126. echo.
  127. echo.
  128. echo.
  129. echo.
  130. @echo off
  131.  
  132. @pause
  133. @cls
  134. @color 1f
  135. @echo This Program will terminate once the SQL uninstaller is complete.
  136. @echo.
  137. @echo.
  138. @echo Select [Remove], Then [OK], Select Instance [SQL_ICCM] Then [Next], [Select ALL] then [Next], [Next], [Remove], [Next], Then [Close]
  139. @ "C:\Program Files (x86)\Microsoft SQL Server\100\Setup Bootstrap\Release\x86\SetupARP.exe" >nul
  140. @ "C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Release\x86\SetupARP.exe" >nul
  141. goto :eof
  142.  
  143. :ColorText
  144. echo off
  145. echo %DEL% > "%~2"
  146. findstr /v /a:%1 /R "^$" "%~2" nul
  147. del "%~2" > nul 2>&1
  148. goto :eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement