strState = ""
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colRunningServices = objWMIService.ExecQuery _
("Select * from Win32_Service where Name='Themes' ")
For Each objService in colRunningServices
Wscript.Echo objService.DisplayName & VbTab & objService.State
If objService.DisplayName = "Themes" Then
If objService.State = " Running" Then
errReturnCode = objService.StopService()
Else
errReturnCode = objService.StartService()
End If
End
Wednesday, October 20, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment