Guest

uninstall ws1

Apr 27th, 2026
14
0
Never
Not a member of GistPad yet? Sign Up, it unlocks many cool features!
None 13.78 KB | None | 0 0
  1. @echo off
  2.  
  3. :: Created by: Ionut (Mike) Dutan
  4. :: Created on: December 1, 2022
  5. :: Updated on: March 14, 2023
  6. :: Version: Revision 4
  7.  
  8. :: Opening CMD maximized
  9. if not "%1" == "max" start /MAX cmd /c %0 max & exit/b\
  10.  
  11. echo *************************** Workspace ONE Intelligent Hub removal process ***************************
  12.  
  13. :: Prompt to Run as administrator
  14. Set "Variable=0" & if exist "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs"
  15. fsutil dirty query %systemdrive% >nul 2>&1 && goto :(Privileges_got)
  16. If "%1"=="%Variable%" (echo. &echo. Please right-click on the file and select &echo. "Run as administrator". &echo. Press any key to exit. &pause>nul 2>&1& exit)
  17. cmd /u /c echo Set UAC = CreateObject^("Shell.Application"^) : UAC.ShellExecute "%~0", "%Variable%", "", "runas", 1 > "%temp%\getadmin.vbs"&cscript //nologo "%temp%\getadmin.vbs" & exit
  18. :(Privileges_got)
  19.  
  20. :: Checking Bitlocker status
  21. echo 1. Checking Bitlocker status
  22.  
  23. for /f %%i in ('powershell -command "Get-BitLockerVolume -MountPoint C: | Select-Object -ExpandProperty EncryptionMethod"') do set VAR=%%i
  24. echo %VAR%
  25. if "%VAR%"=="None" (
  26. GOTO :NotEncrypted
  27. ) ELSE (
  28. GOTO :Encrypted
  29. )
  30.  
  31. :Encrypted
  32. echo.
  33. echo Detected drive encryption method is "%VAR%"
  34. echo.
  35. echo Your drive is Encrypted with Bitlocker. Please remove the Encryption profile from EMM and start decryption.
  36. echo.
  37. echo Setup will exit now
  38. echo.
  39. timeout 10
  40. exit
  41.  
  42. :NotEncrypted
  43. echo.
  44. echo Detected drive encryption method is "%VAR%"
  45. echo.
  46. echo Your drive is not Encrypted. Process can continue further
  47. echo.
  48. pause
  49. echo.
  50.  
  51. :: Removing WS1 Scheduled Tasks
  52. echo 2. Removing WS1 Scheduled Tasks
  53.  
  54. schtasks /delete /tn "Airwatch" /f
  55. schtasks /delete /tn "IntelligentHubUninstaller" /f
  56. schtasks /delete /tn "VMwareHubHealthMonitoringJob" /f
  57. schtasks /delete /tn "PostOOBEPhase18hours" /f
  58. schtasks /delete /tn "PostOOBEPhase1logon" /f
  59. schtasks /delete /tn "PostOOBEPhase1Unlock" /f
  60. schtasks /delete /tn "VMWare\SfdAgent\Check Required Apps" /f
  61. schtasks /delete /tn "VMWare\SfdAgent\Install Validation Task" /f
  62. schtasks /delete /tn "VMWare\SfdAgent\Software Distribution Queue Task" /f
  63. echo Done.
  64. echo.
  65.  
  66. :: Checking and Stopping the running WS1 processes
  67. echo 3. Checking and Stopping the running WS1 processes
  68.  
  69. tasklist /FI "IMAGENAME eq AwWindowsIpc.exe" 2>NUL | find /I /N "AwWindowsIpc.exe">NUL
  70. if "%ERRORLEVEL%"=="0" taskkill /f /im AwWindowsIpc.exe
  71. tasklist /FI "IMAGENAME eq AWProcessCommands.exe" 2>NUL | find /I /N "AWProcessCommands.exe">NUL
  72. if "%ERRORLEVEL%"=="0" taskkill /f /im AWProcessCommands.exe
  73. echo Done.
  74. echo.
  75.  
  76. :: Uninstalling Workspace ONE Intelligent Hub
  77. echo 4. Uninstalling Workspace ONE Intelligent Hub
  78.  
  79. powershell -Command "Get-AppxPackage AirWatchLLC.WorkspaceONEIntelligentHub | Remove-AppxPackage"
  80. echo Done.
  81. echo.
  82.  
  83. :: Uninstalling Workspace ONE Intelligent Hub Installer
  84. echo 5. Uninstalling Workspace ONE Intelligent Hub Installer
  85.  
  86. wmic product where name="Workspace ONE Intelligent Hub Installer" call uninstall /nointeractive
  87. echo Done.
  88. echo.
  89.  
  90. :: Checking & Stopping WS1 Oracle uninstall script and removing its leftovers
  91. echo 6. Checking and Stopping WS1 Oracle uninstall script and removing its leftovers
  92.  
  93. tasklist /FI "IMAGENAME eq powershell.exe" 2>NUL | find /I /N "powershell.exe">NUL
  94. if "%ERRORLEVEL%"=="0" taskkill /f /im powershell.exe
  95. if exist "%programfiles(x86)%\Airwatch" (
  96. takeown /f "%programfiles(x86)%\Airwatch"
  97. attrib -r -s -h /s /d "%programfiles(x86)%\Airwatch"
  98. rmdir /s /q "%programfiles(x86)%\Airwatch"
  99. )
  100. echo Done.
  101. echo.
  102.  
  103. :: Stopping AirwatchService
  104. echo 7. Stopping AirwatchService
  105.  
  106. net stop Airwatch
  107. echo.
  108.  
  109. :: Removing Registry leftovers
  110. echo 8. Checking and Removing WS1 Registry leftovers
  111.  
  112. reg delete "HKLM\SOFTWARE\Airwatch" /f
  113. reg delete "HKLM\SOFTWARE\AirwatchMDM" /f
  114. reg delete "HKLM\SOFTWARE\Microsoft\Enrollments" /f
  115. reg delete "HKLM\SOFTWARE\Microsoft\EnterpriseDesktopAppManagement" /f
  116. reg delete "HKLM\SOFTWARE\Microsoft\EnterpriseResourceManager\Tracked" /f
  117. reg delete "HKLM\SOFTWARE\Provisioning\OMADM\Accounts" /f
  118. reg delete "HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\WorkspaceONEIntelligentHub" /f
  119. reg delete "HKLM\System\Currentcontrolset\Services\AirWatchService" /f
  120. echo Done.
  121. echo.
  122.  
  123. :: Removing WS1 leftovers from System folders
  124. echo 9. Checking and Removing WS1 leftovers from System folders
  125.  
  126. if exist "%programdata%\Airwatch" (
  127. takeown /f "%programdata%\Airwatch"
  128. attrib -r -s -h /s /d "%programdata%\Airwatch"
  129. rmdir /s /q "%programdata%\Airwatch"
  130. )
  131. if exist "%programdata%\AirWatchMDM" (
  132. takeown /f "%programdata%\AirWatchMDM"
  133. attrib -r -s -h /s /d "%programdata%\AirWatchMDM"
  134. rmdir /s /q "%programdata%\AirWatchMDM"
  135. )
  136. if exist "%programdata%\Packages\AirWatchLLC.WorkspaceONEIntelligentHub_htcwkw4rx2gx4" (
  137. takeown /f "%programdata%\Packages\AirWatchLLC.WorkspaceONEIntelligentHub_htcwkw4rx2gx4"
  138. attrib -r -s -h /s /d "%programdata%\Packages\AirWatchLLC.WorkspaceONEIntelligentHub_htcwkw4rx2gx4"
  139. rmdir /s /q "%programdata%\Packages\AirWatchLLC.WorkspaceONEIntelligentHub_htcwkw4rx2gx4"
  140. )
  141. if exist "%systemroot%\system32\AirWatchMDM.dll" (
  142. takeown /f "%systemroot%\system32\AirWatchMDM.dll"
  143. attrib -r -s -h /s /d "%systemroot%\system32\AirWatchMDM.dll"
  144. del "%systemroot%\system32\AirWatchMDM.dll"
  145. )
  146. echo Done.
  147. echo.
  148.  
  149. :: Restart computer
  150. :: cls
  151. echo It is required to restart the computer to finish the WS1 removal process.
  152. echo.
  153. echo Please save and close anything open now, before the computer is restarted.
  154. echo.
  155. pause
  156. echo.
  157. echo.
  158. echo.
  159. echo *** Restart computer now. ***
  160. echo.
  161. pause
  162. shutdown /r /f /t 0
RAW Paste Data Copied