Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

How to schedule a Windows server to reboot at a specified time?

It's about a Windows Server 2003 and Windows Server 2008.

share|improve this question
add comment

3 Answers

up vote 12 down vote accepted

Make a scheduled task that runs:

shutdown -r -t 01
share|improve this answer
    
Can the scheduled task delete itself when the task is done? –  Toro Apr 30 '09 at 21:25
    
Can't delete itself, but you can setup a one-time trigger so it'll only run once. –  Mark S. Rasmussen Apr 30 '09 at 21:28
1  
If the task is scheduled to run once, there is a "delete this task if it is not scheduled to run again" checkbox under the Settings tab of the scheduled task properties window. The scheduler will remove the task after it has run if not scheduled again. Not sure how that will work in the case of a server reboot, though it is theoretically possible. –  Justin Scott Apr 30 '09 at 21:43
    
Or, if it is a one-time affair, use the /t xxx to set the shutdown to the desired future time. The delay value can be up to 10 years. (But since it is expressed in seconds, having a very long delay calls for a bit of calculus.) –  Jesper Mortensen Sep 22 '09 at 14:52
add comment

The easiest way to schedule a simple reboot is to use the AT command along with the shutdown command from the command line.

For example, if you want the server to restart tonight at 2AM, it can be as simple as this:

at 2:00 shutdown /r /f

What the "AT" command does is automatically create a scheduled task for a certain command. It has a ton of parameters that you can specify to repeat it, but by default it'll just run whatever command you specify at the next instance of whatever time you specify.

If you need to change anything after you issue it, you can just go into Administrative Tools > Scheduled Tasks and modify the task.

share|improve this answer
    
Apparently this has been deprecated in Server 2012 –  Matias Nino Feb 16 '13 at 8:14
add comment

Try this guide (XP centric but should get you in the right direction)

http://www.electronics.dit.ie/techsupport/Green/How%20to%20schedule%20windows%20XP%20to%20shutdown.doc

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.