strComputer = "."
strService = " 'W32Time' "
Set objWMIService = GetObject("winmgmts:"& _ "{impersonationLevel=impersonate}!\\"& strComputer & "\root\cimv2")Set colListOfServices = objWMIService.ExecQuery("Select * from _ Win32_Service Where Name ="& strService & " ")
For Each objService in colListOfServices
objService.StopService()
Next
Note : here strService is Services Name which you are going to start. you get this name from control panel\Administrative Tools\Services... and right click and select properties on the Service , here you can find Service Name.

Custom Search
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.