Solved

Stop Service, Wait 5 Minutes, Then restart computer

Posted on 2007-11-15
5
938 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we want to have a look at the directory attributes which are used by Microsoft to store the so called Security Identifiers (SID). These SIDs plays an important role in delegating and granting permissions and in authentication of trus…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

724 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