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

Restart Batch File.. 1

Status
Not open for further replies.

bigpapapump

IS-IT--Management
Apr 8, 2003
174
US
I want to restart my Win2k server every Sunday. I thought I could use Scheduler with a batch file, but I haven't been able to find the right code.
Anyone know what the command line should be to do a restart?
 
Check to see if you have shutdown.exe on the server. If not, go get the Resource Kit for Windows 2000 Server. It comes with that.

You'll want to use "shutdown.exe /L /R /T:3 /Y /C".

Denny

Between the ESP=ON and the RUM (Read Users Mind) upgrade, I'm ready to go.
 
Thanks for the quick response!

Am I using all of those switches and if so which one equals 'restart'?

Thanks again for the response.
 
Never mind...found it.

Supported switches:
-l -> Log Off.
-u -> Shutdown (Turn Off).
-r -> Restart.
-h -> Hibernate.
-s -> Stand By (Sleep).
-f -> Force the action.
-c -> Cancel a running shutdown.
-t sec -> Delay for number of seconds.


Usage examples:


Log off current user and forces quick shutdown of applications: shutdown -l -f
Initate standby in 30 seconds: shutdown -s -t 30
Cancel all initiated actions: shutdown -c
Shut the computer down: shutdown -u
Restart the computer: shutdown -r
Hibernate the computer: shutdown -h
Wait 10 seconds before shutting down the computer: shutdown -u -t 10
 
Yep. Those look like the switches for the 2003 version? Or I'm still using the NT4 version. Either way, looks like your in the right direction.

Denny

--Anything is possible. All it takes is a little research. (Me)
 
I have a Windows 2000 Server (SP3) that automatically restarts every morning at approx 3am. I have checked for the batch files, schedules tasks, power options, BIOS but can not locate how it restarts.

I have stayed up til 3am to witness the spooky restart. Is there anyway I can disable this using Windows 2000 Resource Kit? Where should I locate the cause of restarting and how can I disable it?

Your help in this matter is much appreciated.

Kind Regards


Saddat Abid
 
Try and check you service proporties !

They can be set to restart server if service stops and so on .

MVH Nicolai
 
do a search for shutdown.exe and move it to a different location and see if it still reboots.
 
oh, careful when moving it because you may have to put it back.
 
Can I disable shutdown.exe to stop the server from restarting? Can I uninstall shutdown.exe? Because it is a live Exchange, file & DC I do not like to risk server being down?

Any help...
 
You can rename it to shutdown.old. That way it can't be used to restart the server.

Denny

--Anything is possible. All it takes is a little research. (Me)
 
mrdenny, emiller52

Searched for Shutdown.exe but can not locate the file.

Any suggestions?
 
Have you checked your Event Logs, they may have info on the culprit. Another long shot, but check your Startup and Recovery, in there is a switch for Automatically Restart on a system failure. This may not be it since it restarts exactly at 3am. Also, check any other servers you may have for a batch that may remotely reboot a server. This may have been setup by a previous admin.

Cliff, CCNA/MCSE/MCSA 2000
Network Administrator
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top