One of the reasons why your computer may become slow over time is because the files on the hard drive can become fragmented. Now what’s that?
Disk Fragmentation for Non-Techies
As you start filling your hard-drive with new programs, documents, and other files, the operating system tries to find vacant places on the hard-drive to place these files. Like an artist who breaks a tile into multiple pieces to form a mosaic, your computer will break these file into chunks (or fragments) and store them in different places across your hard drive.
When you load a program or open a file, the computer will have to first assemble these "fragmented" pieces thus decreasing the performance. And fragmentation is not just an issue with your computer’s hard disk but even removable devices like the USB Flash Drive or your external drives can also become fragmented with time.
Alternate Windows Disk Defragmenter from Microsoft
A Disk Defragmenter program helps because it will pre-arrange all the "fragmented" pieces of a file close together thus reducing the time it takes to open files or load programs on your computer.
Now almost every version of Windows includes a disk defragmenter utility but the problem with these built-in tools is that that will defragment the entire hard-drive at once and they’ll ignore files that are smaller than 64 MB. Luckily, Microsoft offers another free but lesser-known utility called Contig (short for contiguous) that lets you have more control over the defragmentation process.

What’s unique about Contig is that it lets you defragment individual files, folders, or the entire hard drive. You can run Contig from the command prompt but if that sounds a bit technical, you can also look at Power Defragmenter – an easy and more visual interface for Contig.
Using Power Defragmenter, you can visually select files, folders, or the drive you wish to defragment, and Power Defragmenter will internally use Contig to perform the defragmentation process. You may use Contig on machines running Windows XP, Vista and Windows 7.
For instance, if I were to defragment all the documents on my disk and none of the other files, the command* will be:
Contig.exe -v -s c:\Users\labnol\Documents\*.*
[*] You’ll need to run the utility as an administrator as it will throw an "Access denied" error.
And here’s a detailed output of a standard Contig command that tells you exactly what happens behind the scenes per file.

Unlike other third-party defragmentation tools, Contig uses Windows’ internal defragmentation APIs so it won’t cause disk corruption, even if you terminate the program while its running.
Please note, however, that defragmentation is only recommended for traditional hard drives; computers using newer flash memory based solid-state drives should not use traditional defragmenters. Even though file fragmentation may occur on these drives, it should not impact performance due to the nature of flash memory. Additionally, defragmentation may actually decrease the life of a solid-state drive; however, they cannot cause this on a traditional platter-based hard drive.
Related: How to Reinstall Windows Without Losing Data
Find this article at: http://www.labnol.org/software/free-disk-defragmenter-from-microsoft/10808/
Tags: command line, Downloads, feature, freeware, utilities, windows, Software

Reader Comments
Really helpful for beginners and pros alike. I would like to know that are these Defragmentation utilities really doing the exact job they are expected to do? I mean, just for negligible performace increase, is it advisable to run such utility for hours altogether? It does affect the system as it has to physically stackup the data systematically on a hard drive.
Written by Jal on 10.26.09
edit: last line “actually decrease the life or a solid-state drive;” … of
Written by Paul Patrick Dale on 10.26.09
>Unlike other third-party defragmentation tools, Contig uses Windows’ internal defragmentation APIs
Actually most (if not all of modern) defrag utilities use Windows APIs. There are simply too few reasons to not use those.
Some shareware products tried to make exclusive feature out of own code to move files around… Well, as far as I know they died out. :)
Written by Rarst on 10.26.09
It’s not from Microsoft..
It’s by Sysinternals, which was bought by Microsoft.
Written by VivekM on 10.26.09
Contig is the part of Mark Russinovich’s Sysinternals, which was bought by microsoft sometime back. They offered quite a few utility programs such as process explorer, a better version to task manager, and autoruns, a better version for msconfig for startup programs.
All of their tools are very handy and highly recommended.
Written by Sanjay Goel on 10.27.09