Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rebooting a Windows 2000 Pro pc using a command in a batch file

Status
Not open for further replies.

bhogaj31

IS-IT--Management
Mar 11, 2003
114
GB
Hi

Env = Win2k pro in NT4 Domain

I am trying to reboot a computer as part of an automated unattended install of Win2000 Pro.

I have got got hold of a bunch of files one of which is called "Restart.VBS" and I call this up just by referencing the name in a batch file.

The file contains the following syntax.

set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys "^{ESC}ur{ENTER}"


The problem is that it doesn't reboot the computer when called up within the batch file. If I just double click on it or type "restart" at the CMD prompt from the directory in which it exists it does what it is supposed to and performs the restart.

Am I calling it up incorrectly, usng the wrong switches or something?


Any help would be greatly appreciated





 
wolluf, I believe he is. They removed the shutdown.exe from reskit and replaced it with the .vbs he is using.

I believe either of these will work, and Call will not:

CMD /k restart.vbs

-or-

Start restart.vbs
 
Thank you , but I have got it working.

I was calling a different .bat file before I called "Restart.vbs" but I didn't put the "Call" syntax in front of the .bat file.

As soon as I put "call" myfile.bat into my master file it seemed to run the restart.vbs fine .


Thank you for all your help and the quick response.

 
I would still use the freeware pstools utility linked above. You likely can find other terrific things in the free toolkit if you have not had a chance to explore it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top