
Stopping and Starting NT Services
Got this to work on my NT box, but it's sloooooooow (15-25 seconds just to get the status)...
Is this typical for ADSI?
Box is P166 w/64MB memory.
--
Mike Harris
I thought I was....
Set Service = ("WinNT://Your_computer/Your_service")
If Service.Status = 1 then
msgbox "service is stopped"
End If
You need ADSI first
Clarence
can you be a little more specific? a search at your site for server.status or for server status gave no hits...
--
Mike Harris
Service.status
1 = stopped or disabled
4 = started
7 = paused
Clarence
Check it out..
Http://cwashington.netreach.net
On this site you will find resources for all of your scripting needs. Everything you need to get up and running. Over 100 Sample Scripts, ActiveX controls, reference materials, and technical support via an online discussion lounge.
[ Win32Scripting... automate!! ]
I'm using WSH and VBScripts.
Is there a way of
testing if a specific NT Service is running and,
depending on the outcome of the test,
stop or start the service using WSH scripting?
Kjell