Search

Want to make a suggestion on how to improve this guide? Feedback (do not use to
ask questions; instead use the Search box above).

MS-DOS Commands :: defrag

Overview:

Warning: This command is for advanced users only!

The defrag command
defragments the specified drive.
Note: Depending upon the capacity of the drive and the amount of fragmentation, the defragmentation
process can take a considerable amount of time to finish (e.g.: hours).

Tip: Unless you have a reason for using the defrag command, instead
use the defragmentation tool of Windows
Explorer.

Tip: If you want to defragment an individual file (or a group of files) rather than an entire
drive, use config instead.

Command Options:

There are a few options you can use with the defrag command. For the complet list of options,
type: defrag /?

The following examples demonstrate some of the more useful options:

defrag drive: -v

Defragment the specified drive. Displays verbose information about the analysis and defragmentation. For example, to
defragment the c: drive, use: defrag c: -v

defrag drive: -adefrag drive: -a -v

Do not perform defragmentation, but merely perform an analysis of the current state of the drive's fragmentation.
Include the -v option to display verbose information during the analysis. For example, to analyze the
fragmentation of the c: drive, use: defrag c: -a
-v