Automatic Disk Defrag on Windows XP
428 words, 3 minutes
Quoting the Microsoft Article ID: How to Automate Disk Defragmenter Using Task Scheduler Tool in Windows XP
- Open Control Panel
- Double-click Scheduled Tasks
- Double-click Add Scheduled Task
- On the Scheduled Task Wizard dialog, click Next
- Click Browse
- In the Select Program to Schedule dialog, navigate to the windowssystem32 folder
- Select defrag.exe
- Click Open
- In the Scheduled Task Wizard dialog, type a name for the scheduled task (Disk Defragmenter, for instance)
- Under Perform this task, select how often you wish Disk Defragmenter to run
- Click Next
- Set the time at which you wish the Disk Defragmenter scheduled task to run. This should be a time when your computer is on, but not in heavy use.
- Select the frequency at which you want the Disk Defragmenter scheduled
task to run (Every Day, Weekdays, or Every
days, where is the number of days between scheduled runs) - Click Next
- Enter a user name under which the Disk Defragmenter scheduled task will run. Note: This user must be an administrator on the local machine.
- Enter the password for the user you entered in the previous step
- Confirm the password for the user
- Click Next
- Check Open advanced properties for this task when I click Finish
- Click Finish
- In the Run text box, you should see the full path and command for
defrag.exe. By default, this path is
C:\WINDOWS\SYSTEM32\defrag.exe
- Append the drive letter for the drive you wish to defragment to the
command in the Run text box. In a default installation, your Run command
will look like this:
C:\WINDOWS\SYSTEM32\defrag.exe C:
- Click OK
- In the Set Account Information dialog, enter and confirm the password for the user listed in Run as
- Click OK
Disk Defragmenter will now run as the specified user on the schedule you specified when you created the scheduled task.
For additional information about using Scheduled Tasks in Windows XP, see the
following article in the Microsoft Knowledge Base:
308569 HOW TO: Schedule Tasks in Windows XP
For additional information about the limitations of the Disk Defragmenter tool
in Windows, see the following article in the Microsoft Knowledge Base:
314848 How to Defragment Your Disk Drive Volumes in Windows XP
For additional information about using the command line Defrag.exe tool, see
the following article in the Microsoft Knowledge Base:
283080 Description of the New Command Line Defrag.exe Included with Windows XP
APPLIES TO Microsoft Windows XP Professional
Microsoft Windows XP Home Edition
Microsoft Windows XP Media Center Edition 2002
unknown KMS 9471
Microsoft Windows XP Tablet PC Edition
Source How to Automate Disk Defragmenter Using Task Scheduler Tool in Windows XP