How to Defragment a Single File and Not the Entire Disk

Posted August 18, 2006 by Rob Rogers in Windows networking

Sysinternals provides the Contig utility, which you can use to defragment individual files or folders.


You can download the tool at the following website:

http://www.sysinternals.com/Utilities/Contig.html

To defragment a single file, use this format:

contig [filename]

To analyze the fragmentation status, add the -a switch as in the following example:

X: emp>contig -a en_whatchmacallit.iso

Alternatively, you can use wild cards in addition to the -s switch to search through the path given and any child folders and perform degragmentation on files matching the given file name criteria. The Contig tool is a great utility to keep important files defragmented without having to worry about the entire disk.

 

About Rob Rogers

Once a prolific author here on Tech-Recipes, Rob has moved on to greener pastures.
View more articles by Rob Rogers

The Conversation

Follow the reactions below and share your own thoughts.