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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Restart Server by command line

Status
Not open for further replies.

chongtl

MIS
Sep 5, 2002
34
MY
Can anyone help?

I need to restart my server every sunday. But I will skip if the Sunday is month end. I want to use the scheduler to run a batch file. I don't know the command.

Anyone know the command to retsart server and command to check the day is Sunday as well as Month end?

Thanks
 
shutdown.exe is a Microsoft tool in the NT4 Resource Kit, which will allow you to shut down (and/or reboot) machines remotely (if you have the correct permissions to do so).

You won't need to check if the day is a Sunday; just set up the AT command to run /every:Sunday.

As for checking to see if it's months end, that will be a little more difficult, and off the top of my head I can't think of a smart way of doing it. [auto] MCSE NT4/W2K
 
Well , you may wright a script that checks the date ,
by getting the info from the system :
if it includes string "30" or "31" ( end of month )
then not to run anything , else , run the shutdown.exe
( all that checking is at the task scheduler , in order to run it only on sundays )
good luck
Alex.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top