Scheduling Tasks
Periodic maintenance and backups aren't useful unless they actually occur periodicallyand human memory often fails here. Scheduled Tasks, which starts and runs each time you start Windows, can schedule programs to run according to a schedule that you specify.Now things become more technical. It does you no good simply to open a program on schedule; you must specify the command name and command-line options that make it run to completion without your intervention. A command name is a program's filename as typed at a command prompt (choose Start > All Programs > Accessories > Command Prompt). Disk Defragmenter's command name is defrag, and Backup's is ntbackup, for example. Command-line options, or switches, are space-separated parametersprefixed by a - or / characterthat follow the command name and control that command's behavior. Search for command-line reference in Help and Support Center to find commands, their switches, and examples (Figure 19.30 ).
Figure 19.30. Help and Support Center's description of the defrag command and its command-line options. The command defrag C: /f defragments your C: drive, for example

1. Choose Start > All Programs > Accessories > System Tools > Scheduled Tasks.2. Right-click an empty area in the Scheduled tasks window; then choose New > Scheduled Task (Figure 19.31 ).
Figure 19.31. The first few times that you schedule a new task, you may want to double-click Add Scheduled Task for a wizard to walk you through the process.

Figure 19.32. In this tab, specify the program that you want to run on a schedule.

Figure 19.33. Click Advanced if you want to set a task's start and end date or make it run repeatedly at specified intervals.

Figure 19.34. Don't just accept some of the nonsensical factory settings on this tab; you should stop a task if it runs for a few hours (not 72, as Microsoft suggests). The bottom section is for laptop users.

TipsChoose View > Details to see schedule information for all tasks, including the earlier and next run times. A 0 or 0x0 in the Last Result column means that a task ran successfully; any other value represents an error.The Advanced menu offers some not-very-advanced commands. Use it to pause all scheduled tasks, shut down Task Scheduler, or notify you of missed tasks.To run a task on demand, right-click it; then choose Run.You can place multiple commands in a text file with a .bat extension and run this batch file as a single task instead of running each command individually.Double-click the taskbar clock to confirm that the system date and time on your computer are accurate. Scheduled Tasks relies on this information.At the command prompt, type a command followed by -? (or /?) to see its command-line options. Type defrag -?, for example.Command-prompt junkies can use the at command instead of Scheduled Tasks.