Defragmenting Drives from the Command Line with DEFRAG

Defragmenting partitions is an important part of regular system maintenance to ensure that disks perform optimally. Although XP includes the GUI-based Disk Defragmenter tool, the DEFRAG command line version of the tool is a simple and effective alternative. To run the tool and force defragmentation on drive E:, the command would be DEFRAG e: -f.

To simply analyze the level of fragmentation on the same disk, the command would be DEFRAG d: -a.

Author: Dan DiNicolo

Dan DiNicolo is a freelance author, consultant, trainer, and the managing editor of He is the author of the CCNA Study Guide found on this site, as well as many books including the PC Magazine titles Windows XP Security Solutions and Windows Vista Security Solutions. Click here to contact Dan.