dion_p1
asked on
Restart Service via Script?
I need to restart a windows service using vbs script the service name is "Papercut Application Server". Is there any way to do this via vbs script ?
ASKER
Is there a way to stop it first?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20
This will start a service.
strComputer = "ComputerName"
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery("S
For Each objItem In colItems
objItem.StartService
Next