Previous Posts


Download free hard drive imaging software

Set default folder for attachments in Outlook 2003...

FTP Files Automatically

Install Windows 2003 Recovery Console

Get ready for Windows 2008

Vulnerability in Virtual PC

Backup and Restore Outlook 2003 auto complete data...

Force Windows Activation Dialog to Show

Encrypt your files the free and easy way

Free New Zealand Daylight saving patch released fo...



Archives

May 2005

January 2006

April 2006

May 2006

June 2006

July 2006

September 2006

October 2006

November 2006

December 2006

January 2007

February 2007

March 2007

April 2007

May 2007

June 2007

July 2007

August 2007

September 2007

October 2007

November 2007

December 2007

January 2008

February 2008

March 2008

April 2008

May 2008



Subscribe to our Feed:






Schedule a reboot in Windows 2003

There is always one application...yes one application that you use all the time, and can't afford to have it down for one minute during the day.

This same application is buggy and always has problems if it keeps running day after day. You need to reboot once in a while. Yes, and this means you need to stay late and wait until everyone leaves...and then reboot.

There is a simple solution to the problem...the shutdown command in windows 2003. It can shutdown or reboot your system from the command line, and will even allow you to specify reason codes for the shutdown. Here is the lowdown on its possible options:

Usage: shutdown [-i | -l | -s | -r | -a] [-f] [-m \\computername] [-t xx] [-c "comment"] [-d up:xx:yy]

No args Display this message (same as -?)
-i Display GUI interface, must be the first option
-l Log off (cannot be used with -m option)
-s Shutdown the computer
-r Shutdown and restart the computer
-a Abort a system shutdown
-m \\computername Remote computer to shutdown/restart/abort
-t xx Set timeout for shutdown to xx seconds
-c "comment" Shutdown comment (maximum of 127 characters)
-f Forces running applications to close without warning
-d [u][p]:xx:yy The reason code for the shutdown
u is the user code
p is a planned shutdown code
xx is the major reason code (positive integer less than 256)
yy is the minor reason code (positive integer less than 65536)


So, if I wanted to shutdown the machine at a specified time I could create a script with the following:

shutdown -r -f -c "Shutdown to refresh buggy program"

The -f makes sure no application can keep the shutdown from happening, and the -c allows me to add a comment in the event log. The -r tells it to reboot.

Now I have saved this as RebootDaily.bat (Under the windows folder)

Lets schedule it to run daily at 3am. Open the control panel and double click on the "Scheduled Tasks", and browse for the batch file that we just saved.

Schedule Reboot Daily


Click next, and set the time you want the reboot to start. If you have any backup jobs I would make sure the job time is far from your reboot.

Schedule Reboot 3AM


Click next and set the user account that will be used for the reboot. I suggest setting up a separate account with specific permissions for this task. That way you can slightly relax your password change policy - and lock it down so it can't do much but reboot the system. Otherwise you will need to make sure you update this task each time the administrator password is changed.

Schedule Reboot Password


Click next, and then finish. Your reboot has been scheduled. Just makes sure it works by manually running it once.

Now your buggy application can get a fresh start every day.


Posted By: Steve Wiseman on Thursday, September 13, 2007

Check out our utilities for windows

 



Copyright © IntelliAdmin, LLC, 2008. All Rights Reserved