Two important tasks that need to be done regularly are disk cleanup and disk defragmentation. Disk cleanup rids your computer of the miscellaneous detritus that accumulates—temporary files of all sorts and old setup files. Disk defragmentation is needed less frequently, but is still required because files tend to get increasingly chopped up over time. Both problems slow your system and both are easy to solve. What's annoying about performing system maintenance tasks is that you can't do anything else with your computer while the hard disks are being cleaned up or defragmented. People put off system maintenance because they have work to do, and are bored by staring at a screen while these kinds of tasks are carried out. Fortunately, with Windows XP you can automate these operations. Just set them up once and forget about them.
Disk Cleanup
The Disk Cleanup tool is found by clicking Start, pointing to All Programs, then Accessories, then System Tools, and then clicking Disk Cleanup. You can, of course, just run the tool by clicking it and following the prompts. After you've done that a few times though, I think you'll find the thrill is gone. Here's how to automate the whole process to run while you're away from your computer:
|
1.
|
Click Run from the Start Menu.
|
|
2.
|
In the Open box, type cleanmgr /sageset:1
|
|
3.
|
Click OK.
|
Disk Cleanup opens with a list of the possible files to be deleted. Select a file type to display a description. Check the boxes for the files you want removed, and click OK.
Next, you can schedule Disk Cleanup to run when you want it to.
|
1.
|
Click Control Panel, then click System and Maintenance, and then click Scheduled Tasks.
|
|
2.
|
Double–click Add Scheduled Task to start the Scheduled Task Wizard. In the list of applications you want Windows to run, click Disk Cleanup, and then click Next.
|
|
3.
|
Select a frequency for the task—weekly is good—and click Next.
|
|
4.
|
Select a day of the week and time for the task to run.
|
|
5.
|
Enter the name and password of a user. The program will be run as if that user started it. Check the box to open Advanced Settings when you're done.
|
|
6.
|
In the Run box, add the following to the end of the path: /sagerun: 1 and then click OK.

|
Task Scheduler will automatically run Disk Cleanup with the settings you selected at the time you selected. (Remember to leave your computer on!)
Note You can customize Disk Cleanup to delete different files at different intervals by specifying more than one sageset. Just change the number to sageset: 2 or sageset: 3 (in fact, any number from 0 to 65535). Each sageset can have different files selected. Then you can set up a separate scheduled task to execute each set by specifying sagerun: 2 and sagerun: 3 and so forth.
Disk Defragmenter
You can also automatically defragment your hard disk, although it doesn't need to be done as frequently as cleaning up your hard disk. Open Scheduled Tasks, and double–click Add Scheduled Tasks to start the Scheduled Task Wizard. When you get to the list of applications, click Browse, and navigate to windows\system32\defrag.exe, and click Open.

Again, select the frequency for the program to run—monthly is usually more than enough. To defragment a disk, you'll need to supply the name and password for an account with administrative privileges. The definition of administrator varies slightly from Windows XP Professional to Windows XP Home Edition, but essentially it means a user who has control over the computer, can install software, and can change user passwords. Check the box to open Advanced Settings when you're done.
In the Run box, add the letter of the drive to defragment so it looks like C:\windows\system32\defrag.exe c:
Only one instance of Disk Defragmenter can be running at any given time, so if you have multiple partitions, you'll need to add a separate scheduled task for each one. You don't need to use the wizard after you're familiar with the procedure. Open Scheduled Tasks from Control Panel, on the File menu point to New, and then click Scheduled Task. Name the new task and double click to open it and fill in the necessary information. Be sure to schedule defragmenting sessions far enough apart so they don't overlap.
Note A minimum of 15 percent free space on your hard disk is needed for Disk Defragmenter to run. This is yet another argument in favor of frequent and aggressive use of the Disk Cleanup tool.
Sharon Crawford is a former editor now engaged in writing books and magazine articles. Since 1993, she has written or co–written two dozen books on computer topics. Her books include Windows 2000 Pro: The Missing Manual, Windows 98: No Experience Required, and Windows 2000 Professional for Dummies (with Andy Rathbone).
|