' StopService (VBS)
' ServiceName is case sensitive.
Public Function StopService(ServiceName)
dim objWMIService, objService
dim strComputer
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
dim colListOfServices
Set colListOfServices = objWMIService.ExecQuery _
("Select * from Win32_Service Where Name = """ & ServiceName & """ ")
if colListOfServices.count then
For Each objService in colListOfServices
objService.StopService()
Next
StopService = true
exit function
end if
StopService = false
End Function