Link to home
Start Free TrialLog in
Avatar of LeviDaily
LeviDailyFlag for United States of America

asked on

Stop Service, Wait 5 Minutes, Then restart computer

I need a simple vbs script that

stops service  d3vme
wait 5 minutes (make sure service stops)
reboot server
Avatar of Badotz
Badotz
Flag of United States of America image

I don't believe there is a sleep command in VBScript, but I could be mistaken...
Avatar of LeviDaily

ASKER

ok...Would the best be to use a batch command? If so, do you have one?
ASKER CERTIFIED SOLUTION
Avatar of RobSampson
RobSampson
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Oh, and you can hide those command prompts:

Set objShell = CreateObject("WScript.Shell")
objShell.Run "net stop d3vme", 0, True
objShell.Run "shutdown -r -t 300", 0, False

The second parameter of zero means run it hidden, the third parameter waits for the comand to finish before processing the next one.

Regards,

Rob.
Thanks!