I use schtasks to automate processes such as defrag and restarts after updates. Below is a line of code from one of my files that restarts production systems daily at 3:00 a.m. I use very similiar code to run defrag after the restarts. This works for us because no systems are in use between midnight and 6:00 a.m.
I like schtasks. Type schtasks /? at command prompt to check it out. As you'll see, there are a lot of options available.
schtasks.exe /create /SC DAILY /TN RebootYou /TR "\"C:\windows\system32\shutdown.exe\"-f -r" /ST 03:00:00 /SD 12/18/2007 /RU SYSTEM
* No need to provide password if you run it under System account.
Happy New Year!
Keep Up with TechRepublic