Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Start & Stop Services with VBScript 1

Status
Not open for further replies.

saw15

Technical User
Jan 24, 2001
468
US
Currently I use a bat file to start and stop services:

net start servicename.

What is it for vbscript ?

Example etc would be helpful.

 
you'll have to use
Set SHELLobj = Createobject("wscript.shell")
SHELLobj.exec("net stop spool")

Should work let me know
 
tHIS STOPS the netdde service

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colServiceList = objWMIService.ExecQuery("Associators of " _
& "{Win32_Service.Name='NetDDE'}"
For each objService in colServiceList
objService.StopService()
Next
Regards
Steve Friday
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top