Schedule Disk Defragmenter to run automatically in Windows XP/2003

schedule-defragmenterYou can schedule the disk deframenter utility to automatically defragrment your hard drives, by creating a scheduled task.

  1. Open Control Panel, double-click Scheduled Tasks
  2. Double-click Add Scheduled Task
  3. On the Scheduled Task Wizard dialog, click Next.
  4. Click Browse and navigate to windows’system32 folder. Select defrag.exe and click Open.
  5. In the Scheduled Task Wizard dialog, type a name for the scheduled task (for example type Disk Defrag).
  6. Under Perform this task, select how often you wish Disk Defragmenter to run. Click Next.
  7. Set the time at which you wish the Disk Defragmenter scheduled task to run. This should be a time when your computer is turned on but not under heavy use (i.e. at night time).
  8. Enter a user name under which the Disk Defragmenter scheduled task will run. This user must be an administrator on the local machine (see note above). Enter the password for that user and confirm it. Click Next.
  9. Check Open advanced properties for this task when I click Finish, and click Finish.
  10. In the Run text box, you can see the full path and command for defrag.exe.

Add the drive letter for the drive you wish to defragment to the command in the Run text box. If you want to defragment drive C:, your Run command should look like this:

C:\WINDOWS\system32\defrag.exe

Click OK

  1. In the Set Account Information dialog, enter and confirm the password for the user listed in Run as and click OK.
  2. Task Scheduler will automatically run Disk Defragmenter with the settings you selected at the time you selected.

Only one instance of Disk Defragmenter can be running at any given time. If you have multiple partitions you’ll need to add a separate scheduled task for each one, and make sure you give each task a different starting time, allowing for the previous one to finish.

  • Share/Bookmark