VBScript to kill services with imagename SYSTEM in Task Manager view doesn't work
To uninstall the application..
I have written a VBScript mainly using taskkill command to kill services..
The script works fine from outside.. but when i embed the script in MSI as a custom action, though the script get's executed, it doesn't kill the services..
The services Imagename in taskmanager view is shown as SYSTEM, so i can't use SC/NET coomands to stop services.. Plz anyone provide me a script that helps stop/kill a service of imagename SYSTEM, that works fine when i embed the script in MSI
I have written a VBScript mainly using taskkill command to kill services..
The script works fine from outside.. but when i embed the script in MSI as a custom action, though the script get's executed, it doesn't kill the services..
The services Imagename in taskmanager view is shown as SYSTEM, so i can't use SC/NET coomands to stop services.. Plz anyone provide me a script that helps stop/kill a service of imagename SYSTEM, that works fine when i embed the script in MSI
0 Comments
[ + ] Show comments
Answers (4)
Please log in to answer
Posted by:
mickman
19 years ago
Posted by:
mickman
19 years ago
I used this:
works great.
Stops the MSSQLSSERVER service and all its dependent services.
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colServiceList = objWMIService.ExecQuery("Associators of " _
& "{Win32_Service.Name='MSSQLSSERVER'} Where " _
& "AssocClass=Win32_DependentService " & "Role=Antecedent" )
For each objService in colServiceList
objService.StopService()
Next
Wscript.Sleep 20000
Set colServiceList = objWMIService.ExecQuery _
("Select * from Win32_Service where Name='MSSQLSSERVER'")
For each objService in colServiceList
errReturn = objService.StopService()
Next
works great.
Posted by:
charan
19 years ago
Posted by:
dj_xest
19 years ago
Charan..
Did you try to check the registry? There are a total of 6 services for MCAffe Desktop Firewall. You can only see 2 Services if you check the Services under the Administrative Tool but if you can try to browse the Registry using REgedit, you can find the other 4! I don't know if I missed other services... Try and stop all of the services and it might kill that process.. Be sure to stop first all of the depency services..
Browse the regedit:
HKLM\SYSTEM\CurrentControlSet\Services
HOpe this help..
Did you try to check the registry? There are a total of 6 services for MCAffe Desktop Firewall. You can only see 2 Services if you check the Services under the Administrative Tool but if you can try to browse the Registry using REgedit, you can find the other 4! I don't know if I missed other services... Try and stop all of the services and it might kill that process.. Be sure to stop first all of the depency services..
Browse the regedit:
HKLM\SYSTEM\CurrentControlSet\Services
HOpe this help..
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.