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
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