Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stopping a service in Vista 64

Status
Not open for further replies.

lance59

IS-IT--Management
Mar 6, 2007
50
US
I am looking for a way to stop a service in Vista 64. This works under XP 32. I don't have Vista 32 but I suspect it would work. It just does not work under Vista 64. I am trying to stop/start the Symantec Antivirus service after I replace the GRC.dat file to point it to a new AV server. Symantec Antivirus is 64 bit.

strComputer = "."
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colListOfServices = objWMIService.ExecQuery ("Select * from Win32_Service Where Name ='Norton Antivirus Server' or Name = 'Symantec Antivirus'")
For Each objService in colListOfServices
objService.StopService()
Next

WScript.Sleep 30*8000

For Each objService in colListOfServices
objService.StartService()
Next
 
If that service is a 64 bit service then it is probably in a different class than one starting with Win32_ though I am afraid I don't know which to look in.

You might want to download a copy of the WMI Tools from Microsoft. That will give you CIM Studio and you will be able to search for all classes that have the word service in them.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top