The Microsoft Management Console houses the Windows XP Disk
Defragmenter, which makes it impossible to schedule a regular defragmenting session via Task Scheduler. However, there’s
also a command line version of this utility, called Defrag.exe,
that you can schedule. To do so, create a batch file that runs
Defrag.exe along with the appropriate parameters, and then create a schedule to
run your batch file.
To run Defrag from the batch file, use the following command
In this command, x
is the drive letter of the hard disk you want to defragment,
and parameter is one of three
optional settings that you can use to configure Defrag:
reports. Can be used
in combination with /a to display only the analysis
needs to be defragmented.
Here’s how to schedule the Disk Defragmenter:
- Launch Notepad.
- Type the appropriate Defrag command line.
- Save the file as Defragger.bat.
- Go to Start | All Programs | Accessories | System Tools |
- Launch the Scheduled Task Wizard by double-clicking Add
- Click Next and select Defragger.bat.
- In the following three screens, select the Weekly or
Monthly option, the time that you want to defragment
your hard disk, and then type a username and password
with Administrative privileges.
- Click Finish.
Now, your computer will regularly run
a defragmentation operation to keep your Windows XP
system in tip-top shape!
This tip applies to both Home and Professional editions.
Miss a tip?
Check out the Windows XP archive, and catch up on our most recent Windows XP tips.
Stay on top of the latest XP tips and tricks with our free Windows XP newsletter, delivered each Thursday. Automatically sign up today!