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!

automating a restart of windows 2000 1

Status
Not open for further replies.

mrslimey

IS-IT--Management
Oct 23, 2003
21
GB
I would like to automate a restart of a windows server. This should be able to be done via a scheduled batch file which shuts down the appropriate services and initiates a restart. Can some help in this area with either a copy of a batch file that they have used previously or for a start point me in the direction of which systems files I should be looking at to research this more.
ta
 
There is a command line utility called "Shutdown.exe" that can be used for shutting down or restarting your local machine or remote machines.

I think you will find it in the resource kit. I know it wasn't native on my Win2K machines and can't remember where I got it for my NT servers.

The NT version is a command line only and uses switches for things like host name, restart after shutdown, end all processes, etc. It will work on Win2k machines as well.

The version I use with my Win2K boxes was copied from a colleague's XP workstation. This one works on both NT and Win2K boxes and can be run in GUI or command line modes. But the switches are slightly different from the NT4 version.

Do a google search for "shutdown.exe" to find lots of posts on how to use it.

You should have a look at it.
 
HI.

Some actions that you can add to such a batch file are logging and email notifications.

For logging, use commands like:
SET LOGFILE=C:\RESTART.LOG
ECHO. >>%LOGFILE%
ECHO --------------------------------- >>%LOGFILE%
DATE /T >>%LOGFILE%
TIME /T >>%LOGFILE%
ECHO Going to restart >>%LOGFILE%
ECHO Stopping services... >>%LOGFILE%
etc....

For notifications, use any tool that can send mail, and then send email both before and after the scheduled restart.
Some tools that can send email are BLAT, MAILIT (from my site), and other that you can find on the web.



Yizhar Hurwitz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top