Hi Everyone,
Please refer attached script to uninstall and remove ITSM, RMM,Patch Management, ITSM Updater and Comodo Client Security.
Note:
The script will be restart an endpoint which is forced by comodo client security uninstall process.
Script should be run as a system user.
You would not able to get any output for this script,only device will be disconnected from ITSM.
import os
import ctypes
temp=os.environ['PROGRAMDATA']+r' emp'
if not os.path.isdir(temp):
os.mkdir(temp)
class disable_file_system_redirection:
_disable = ctypes.windll.kernel32.Wow64DisableWow64FsRedirection
_revert = ctypes.windll.kernel32.Wow64RevertWow64FsRedirection
def __enter__(self):
self.old_value = ctypes.c_long()
self.success = self._disable(ctypes.byref(self.old_value))
def __exit__(self, type, value, traceback):
if self.success:
self._revert(self.old_value)
vbs=r'''
Dim sCmd1
Dim sCmd2
Dim sCmd3
Dim sCmd4
Dim sCmd5
Dim WshShell
sCmd1="wmic product where name=""Comodo One Patch Management Agent"" call uninstall"
sCmd2="wmic product where name=""RMM Agent Service"" call uninstall"
sCmd3="wmic product where name=""COMODO Client - Communication Updater"" call uninstall"
sCmd4="wmic product where name=""COMODO Client - Communication"" call uninstall"
sCmd5="wmic product where name=""COMODO Client - Security"" call uninstall"
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run sCmd1,0, True
WScript.Sleep 10
WshShell.Run sCmd2,0, True
WScript.Sleep 10
WshShell.Run sCmd3,0, True
WScript.Sleep 20
WshShell.Run sCmd4,0, True
WScript.Sleep 10
WshShell.Run sCmd5,0, True
'''
with open(temp+r'\uninstall.vbs',"wb") as f :
f.write(vbs)
with disable_file_system_redirection():
print os.popen('cscript.exe "'+temp+'\uninstall.vbs"').read()
print("Uninstall successfully")
if os.path.isfile(temp+r'\uninstall.vbs'):
os.remove(temp+r'\uninstall.vbs')
20170602-Uninstall-and-remove-RMM-PM-ITSM-CCS-ITSM-Updater.json (2.53 KB)