Command-line switches

WinContig accepts several optional command-line switches that you can use to control how the program operates.

Syntax

wincontig [source] [switches]

Below is the list of the WinContig switches.

Switch Description
source Specifies the files or folders to be loaded in WinContig. You can use wildcards to include all files or only specific files from a folder. source must be enclosed in double quotation marks (" ").
/analyze Starts the analysis of the items loaded in WinContig.
/chkdsk:0 Instructs WinContig to not check the file system of a volume for logical and physical errors prior to defragmenting the files.
/chkdsk:1 Instructs WinContig to automatically check the file system of a volume for logical and physical errors prior to defragmenting the files.
/chkdsk:2 Instructs WinContig to display the Check disk dialog prior to defragmenting the files, and to wait for user action.
/clean:0 Instructs WinContig to not delete the temporary files prior to defragmenting the files.
/clean:1 Instructs WinContig to automatically delete the temporary files prior to defragmenting the files.
/clean:2 Instructs WinContig to display the Disk clean-up dialog prior to defragmenting the files, and to wait for user action.
/close Closes WinContig once the defragmentation process has been completed.
/closeifok Closes WinContig once the defragmentation process has been completed and all files have been successfully defragmented otherwise WinContig stays open. If you use this switch in conjunction with the /nogui switch, WinContig will show the main window after it has completed the defragmentation process if one or more files have not been successfully defragmented.
/defrag Starts the defragmentation of the items loaded in WinContig.
/diskzone:auto Places the file in the first available contiguous run of free clusters that is large enough to contain the entire file.
/diskzone:fast Places the file in the fast zone of the disk. If the specified disk zone does not have a contiguous run of free clusters that is large enough to contain the entire file, the file is skipped. In order to instruct WinContig to not skip the file but try to place the file in a different zone of the disk, append an asterisk (*).
/diskzone:slow Places the file in the slow zone of the disk. If the specified disk zone does not have a contiguous run of free clusters that is large enough to contain the entire file, the file is skipped. In order to instruct WinContig to not skip the file but try to place the file in a different zone of the disk, append an asterisk (*).
/diskzone:cluster Places the file in the specified cluster of the disk. If it is not possible to move the file to the specified disk cluster, the file is skipped. In order to instruct WinContig to not skip the file but try to place the file in a different zone of the disk, starting from the specified disk cluster, append an asterisk (*).
/dup Allows duplicate entries in the items list. WinContig does not allow duplicate entries in the items list as default. When using the /dup switch, WinContig adds files to the items list faster. This option is useful if you want to load a very big profile faster and you are confident there are no duplicate entries in the profile.
/help, /? Displays the Command-line switches dialog.
/lang:xx-XX Forces the language used by the user interface. xx-XX specifies a language, for example en-US represents English, while fr-FR represents French. If you specify the /lang:auto switch, WinContig will use the system default UI language (if supported).
/nogui Hides the WinContig main window during the analysis process or the defragmentation process. When using the /nogui switch, WinContig provides exit codes that indicate the level of success for a command.

The following is a list of the exit codes provided by WinContig.

Exit code Description
0 Success.
1 Invalid or missing profile.
2 Errors were found during the checking of a volume.
3 Not all items were successfully defragmented.
4 Not all items were successfully analyzed.
5 Invalid or missing item.
/noini Suppresses the writing of the wincontig.ini configuration file. This is useful if you want to experiment with the settings of WinContig and you want to prevent changes to existing configuration file.
/nosubdirs Does not include subfolders during the processing of folders.
/ontop Makes the WinContig main window topmost (above all other windows).
/priority:value Changes the priority class of WinContig.

The following values are defined.

high
above-normal
normal
below-normal
low
/prof:profile Loads the specified profile.

Important notes

  • You must specify the full path of the profile.
  • You must enclose the full path of the profile in double quotation marks (" ").
/quick Turns optimizations off during the defragmentation process (i.e., WinContig will not try to fill the gaps and will not try to partially defragment the files that it is not possible to totally defrag). Using this switch decreases the time required to complete the defragmentation process.
/recurse Searches for every occurrence of the specified file name within the specified folder and all subfolders.
/shutdown Shuts the computer down once the defragmentation process has been completed.

See also