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 ).
To schedule a new task:
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 ).
3. Type a name for the task; then press Enter.
4. Double-click the new task.
5. On the Task tab (Figure 19.32 ), in the Run box, type the command to run as the scheduled task.
If necessary, include command-line options and a pathname (see "Exploring Your Computer" in Chapter 5). If the pathname includes spaces, type double quotation marks (") around the entire command.
If the command requires an Administrator to run, and you're not one, type an Administrator's user name in the Run As box; then click Set Password. (Blank passwords are forbidden.) If you're on an XP Pro domain, type
domain_name\user_name .
6. On the Schedule tab (Figure 19.33 ), specify when and how often to run the task.
7. On the Settings tab (Figure 19.34 ), set the conditions under which the task will run.
8. Click OK (or Apply).
Now the task will run according to schedule, even if somebody else (or nobody) is logged on.
Tips
Choose 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.