Reboot Server Automatically Everyday

Posted on 2005-04-21
Last Modified: 2012-05-05
Hi All,

I looking for a program which can auto reboot my server everyday. Any Recommendation?

Question by:fox404
    LVL 57

    Accepted Solution

    Schedule a Reboot

    Recently, Microsoft made the Resource Kit tools and utilities (that come on CD with the Resource Kit) available for download in a new and easy-to-use format.  If you have not already obtained these tools, be sure to see the previous feature which discusses how to download and install them.  Among the myriad of useful tools and utilities is a little command-line utility called Shutdown.exe.  In combination with the AT scheduling service built into NT, this utility allows you to make changes or installations during business hours, and schedule the machine to reboot overnight.

    The Shutdown utility has several options, including rebooting or just shutting down, local or remote NT machines, the length of time before rebooting, whether or not to allow applications the chance to save work, etc.  See the second page of this article for the exact syntax.  I created a small batch file called "reboot.cmd" in notepad, using the appropriate switches, so that I didn't accidentally leave anything out.  Here are the contents of that file:

    shutdown /L /R /Y /C

    When run, this command file will reboot (/R) the local machine (/L) answering "Yes" (/Y) to the question "Are you sure you want a shutdown?[Y/N]" that appears normally when executing the shutdown.exe command.  It will also force all open applications to close (/C), without the opportunity to save any work.  This is OK as far as I'm concerned, because I'm going to close all applications and log out before I go home, after scheduling this command file.

    To schedule this command file, I open a command prompt, and type:

    at 23:00 "c:\reboot.cmd"

    This will cause my machine to execute my reboot.cmd file above, at 11:00 PM.  It will display a warning message on the console screen, and count down 20 seconds (the default) before shutting down and restarting.  Of course, my Schedule service needs to be running in order for the AT command to work.  If I wanted, I could get fancier and use the "Net stop" command with the AT command to stop some services manually just before the reboot, so that I could determine the order and timing of stopping the services.

    You should test this on non-production machines and get comfortable with it before using it.  You could also run the command file by hand when rebooting next time, even though you are present, just to see what it looks like.  I usually follow up by glancing through the Event logs afterwards.  Sometimes I find interesting entries such as "The previous shutdown was unexpected." which makes me wonder how clean this utility works.  Just keep in mind that it could be dangerous, particularly with a machine that has very many services running (for instance a machine with MS Exchange Server, or Oracle installed).  In those cases, you probably should schedule the stopping of those services separate from the reboot.  Also keep in mind that the server will not automatically log itself in after rebooting, so anything that you have in the Startup folder will not run until someone logs in.

    All those dire warnings aside, this utility has proven itself handy to me time and again, and definitely has a place in an NT Administrator's toolkit.  On the next page you will find the correct syntax for the Shutdown and AT utilities, as well as links to the forum and chat room, if you would like to discuss more about these tools.

    LVL 57

    Expert Comment

    by:Pete Long

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Many of us need to configure DHCP server(s) in their environment. We can do that simply via DHCP console on server or using MMC snap-in on each computer with Administrative Tools installed in a network. But what if we have to configure many DHCP ser…
    Setting up a Microsoft WSUS update system is free relatively speaking if you have hard disk space and processor capacity.   However, WSUS can be a blessing and a curse. For example, there is nothing worse than approving updates and they just have…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now