Solved

Stop Service, Wait 5 Minutes, Then restart computer

Posted on 2007-11-15
5
930 Views
Last Modified: 2010-04-21
I need a simple vbs script that

stops service  d3vme
wait 5 minutes (make sure service stops)
reboot server
0
Comment
Question by:LeviDaily
  • 2
  • 2
5 Comments
 
LVL 29

Expert Comment

by:Badotz
ID: 20294139
I don't believe there is a sleep command in VBScript, but I could be mistaken...
0
 
LVL 2

Author Comment

by:LeviDaily
ID: 20294189
ok...Would the best be to use a batch command? If so, do you have one?
0
 
LVL 65

Accepted Solution

by:
RobSampson earned 500 total points
ID: 20294203
Hi, you can use this:

Set objShell = CreateObject("WScript.Shell")
objShell.Run "net stop d3vme"
WScript.Sleep 300000 ' wait five minutes
objShell.Run "shutdown -r -t 0"

Or this to just have the Shutdown timeout to five minutes
Set objShell = CreateObject("WScript.Shell")
objShell.Run "net stop d3vme"
objShell.Run "shutdown -r -t 300"


Regards,

Rob.
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 20294215
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.
0
 
LVL 2

Author Closing Comment

by:LeviDaily
ID: 31409471
Thanks!
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Script to copy or move mouse-selected collection of files plus targets referenced by shortcuts (.lnk) The purpose of this article is to help illuminate the real challenges and options available (where they may exist) for utilizing simple scriptin…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now