CONTIG Tool – Defragment individual files or folders

contig tool parameters

The defragmentation  (“defrag.exe”) of Windows systems is basically a very important Windows function  and Microsoft has changed a lot in the area of defragmentation in the past years , we have already reported about it several times. At the end of this article you will find corresponding links to further defragmentation articles.

Defragmentation normally works on the basis of the entire hard disk , so that all data areas that belong together due to their file structure are always stored in related areas on the HDD or SSD . In the meantime, the defragmentation jobs run automatically in the background when the PC is not actively being used so that there is no loss of speed . In the past, Windows users had to start this process manually at regular intervals.

In addition to the Windows defragmentation that Microsoft ships with as standard, there are also many other companies that have tools that do this task.

Today we want to introduce you to a tool with which you can not defragment the entire hard disk , but individual files. The tool is from Microsoft’s Sysinternal Tools and can be used free of charge. The name of the tool is:


You just have to download the small tool and copy the extracted files into the Windows directory C: Windows so that you always have access to the tool. There are 2 versions, CONTIG for 32-bit Windows versions and CONTIG64 for x64 Windows versions.

contig command parameters

Version 1.8 of the program is currently available.

The following options and parameters are available with the CONTIG command :

contig [-v] [-a] [-q] [-s] [-v] [filename]

  • -v = Show information about file defragmentation operations
  • -a = shows how fragmented the files are
  • -q = defragmentation without display
  • -n = Creates a new file
  • -s = recursive processing of the subdirectories
  • -v = verbose display

Here is an example in which we have defragmented the entire “Download” folder in the user profile .


It is nice to see that a total of 193 were examined in the folder and 153 files were defragmented, 40 files were skipped because they are not fragmented.

The Contig  command  uses built-in Windows defragmentation support . First, Contig scans the disk and collects the locations and sizes of the free areas. Contig then determines where the file is on the disk and determines whether the file can be optimized . This is determined based on the free areas and the number of fragments that make up the file. During the optimization , the file is then written to a free area on the hard disk so that it can be read in completely in one process during the reading process and the file fragments are not distributed across the hard disk.

Below you will find the Contig download link.
– Download CONTIG TOOL (Microsoft Sysinternal Tools)

In the past we have already reported several times about Windows defragmentation , here you will find numerous interesting articles on this topic:

– Defragmentation (defrag.exe) parameters
– Switch off automatic defragmentation in Windows 10
– Increase the service life of the SSD hard drive – Switch off automatic defragmentation
– Deactivate automatic defragmentation in Vista and Windows 7

– Call up defragmentation directly from Explorer
– Increase or decrease partition in Windows 10
– Detect PC performance problems with Fix it Tool from Microsoft
– Reduce partition and VHD of a VM