Discussion Locked

Scripts to automate reboot servers sched

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

HI

Anyone know how to write scripts to reboot servers in weekends automatically. It should stop the services and start the services after rebbot. Is there freeware software available?. Advice is very helpful.
Thanks

3 replies

by abarnes70

You can use SHUTDOWN.EXE from the NT and/or 2000 Resource Kits to restart the server from a batch file, and use the AT command to schedule the batch file.

If services are set to start Automatically you don't need to worry about starting them manually. However, if you specifically want to stop and start services, you can use the NET STOP and NET START commands to do that from a batch file too.

A sample batch file might look like:

@echo off
net stop "Event Log"
c:\apps\batch\shutdown /r /l

and you could schedule that to run with the AT command.

by vinnyd

This is the command that I use

at 23:30 /every:s "shutdown /r /l /c"

The at command schedules the shutdown at 11:30 pm and runs every saturday.

The /r means reboot (not just shutdown)
The /l (lower case L) means local computer
The /c means close any open windows

This discussion is closed to new replies.