Tuesday, 21 June 2011

VB Script to Stop a service

strComputer = "."
strServiceName = "CVPND"
Set a= GetObject("winmgmts:\\" & strComputer)
Set b = a.ExecQuery("Select * from Win32_Service Where Name ='" & strServiceName & "'")
For Each c in b
    c.StopService()
Next

No comments:

Post a Comment