Windows XP includes the Disk Defragmenter MMC, which helps you maintain the disk performance by defragmenting volumes that use the FAT, FAT32, or NTFS file system. However, the Defragmenter MMC, a GUI tool, cannot be used with Task Scheduler.
Windows XP includes the Disk Defragmenter MMC, which helps you maintain the disk performance by defragmenting volumes that use the FAT, FAT32, or NTFS file system. However, the Defragmenter MMC, a GUI tool, cannot be used with Task Scheduler.
To schedule disk defragmentation, you need to use the Defrag.exe command line tool, included in Windows XP. For additional information about using the command line Defrag.exe tool, visit the following page:
Description of the New Command Line Defrag.exe Included with Windows XP
This article tells you how to automate disk defragmenter with Task Scheduler in Windows XP. Screenshots are included at the bottom.
- Daily
- Weekly
- Monthly
- One time only
- When my computer starts (before a user logs on)
- When I log on (only after the current user logs on)
Note that the information about the day and time to run the task vary depending on the selection that you made in the previous wizard dialog box. For example, if you chose Weekly, you must indicate the day of the week, the time, and if the task should run every week, every 2 weeks, every 3 weeks, and so on.
Important note: In the 9th step, you need to add the parameters for the Defrag.exe command. To defragment C:\ drive, the command-line would be:
C:\Windows\System32\Defrag.exe C:
For more information regarding the command-line parameters supported by defrag.exe, type Defrag.exe /? in a Command Prompt window. Scheduling Defrag.exe without any parameters will not help. If no parameters are mentioned, it will just simply execute with a exit code 0 (success), without defragmenting the hard drive.