Home » Support » Tutorials/Power Tips » UltraCompare » Command line tips

IDM PowerTips

UltraCompare command line tips

Note: The information below applies for all UltraCompare Professional versions 6.40 and later. If you are using an earlier version, please refer to the "Command Line Options" help topic in the application's Help files.

UltraCompare Professional supports command line functionality, allowing you to automate compares with output information. Many options may be set on the command line as well.

However, the syntax and format of how these options are used is important. There are a few rules that must be observed when using UltraCompare's command line functionality:

  1. All parameters must be separated by a space.
  2. "Compare type" switches such as -t, -3, -p, -x, -d, and -w must always immediately precede the related compare object (the paths for the files/folders being compared). Any other switches such as -o, -ne, -a, -title1, and -horz should follow the compare objects.
  3. Logical units can appear in any order on the command line so long as they are paired with their related parameters.

Synopsis

uc [COMPARE MODE OPTIONS] ... [COMPARE OBJECTS] ... [COMPARE DISPLAY OPTIONS] ... [OUTPUT FILE]

Correct example:

uc -i -lt -B -b -t <filepath1> <filepath2> -a -o <output file path>

Incorrect example:

uc -i -lt -o -B -b -t -a <filepath1> <filepath2> <output file path>

Correct example:

uc -w -r -dmf <folder1> -title1 "myFolder1" <folder2> -title2 "myFolder2" <folder3> -title3 "myFolder3" -o <output file path>

Incorrect example:

uc -w -r -dmf -o -title1 "myFolder1" -title2 "myFolder2" -title3 "myFolder3" <output file path> <folder1> <folder2> <folder3>


File compare parameters

Parameter Meaning
-t invokes text compare mode
-3 invokes text compare of 3 files
-p invokes fast binary compare of files
-x invokes smart binary compare of files
-qc invokes quick diff check (application does not open - see "Quick Difference" power tip)
-a enables "Show all" (both differences and similarities are displayed) for text mode compare
-m enables "Show matching" (only similar lines are displayed) for text mode compare
-ne enables "Show differences" (only different lines are displayed) for text mode compare
-B enables "Ignore blank lines" option for text mode compare
-b enables "Ignore spaces" option for text mode compare
-i enables "Ignore case" option for text mode compare
-lt enables "Ignore line terminators" option for text mode compare
-rio resets (clears) ignore options
-rom enables "read-only" merge mode

Folder compare parameters

Parameter Meaning
-d invokes folder mode compare
-w invokes 3-way folder mode compare
-dmb sets folder compare type to Basic
-dmf sets folder compare type to Full
-dms sets folder compare type to Smart
-r enables recursive folder compare
-fb forces a binary comparison of all files in a folder compare (only to be used when invoking a smart folder compare)
-ft forces a text comparison of all files in a folder compare (only to be used when invoking a smart folder compare)

Other compare parameters

Parameter Meaning
-o creates output file
-op appends output of compare to specified (existing) output file
-title1 / -title2 / -title3 sets alias or title name for the first / second / third file or folder
-vert sets view of compare frames to vertical layout
-horz sets view of compare frames to horizontal layout

Note: If an output file is specified, the UltraCompare GUI will open, the output file will be created, and the GUI will then close automatically (usually this happens very quickly). If an output file is not specified, the UltraCompare GUI will open and wait for user interaction.


Example command line calls

Syntax Meaning
uc -t "c:\1.txt" "c:\2.txt" -o "c:\output.txt" Invokes a text compare of 1.txt and 2.txt (with default options) and automatically saves an output file to c:\output.txt
uc -3 "c:\1.txt" "c:\2.txt" "c:\3.txt" -o "c:\output.txt" Invokes a 3-way text compare of 1.txt, 2.txt, and 3.txt and automatically saves an output file to c:\output.txt
uc -t -i -b -B "c:\1.txt" "c:\2.txt" -ne -o "c:\output.txt" Invokes a 2-way text compare of 1.txt and 2.txt with "Ignore case", "Ignore spaces", and "Ignore blank lines" set, and will only report differences in output file c:\output.txt
uc -p "c:\info1.dmp" "c:\info2.dmp" -o "c:\output.txt" Invokes a fast binary file compare of info1.dmp and info2.dmp and automatically saves an output file to c:\output.txt
uc -t "c:\1.txt" "c:\2.txt" -horz Invokes a text compare of 1.txt and 2.txt and displays the compare frames horizontally in the GUI
uc -d -dmb "c:\dir1" "c:\dir2" -o "c:\output.txt" Invokes a basic folder compare of dir1 and dir2 and automatically saves an output file to c:\output.txt
uc -w -dms -r "c:\dir1" "c:\dir2" "c:\dir3" -o "c:\output.txt" Invokes a smart recursive folder compare of dir1, dir2, and dir3 and automatically saves an output file to c:\output.txt
uc -dms -r "c:\dir1" "c:\dir2" "c:\dir3" -title1 "myFolder1" -title2 "myFolder2" Invokes a smart recursive folder compare of dir1 and dir2, and displays the directories in the GUI as "myFolder1" and "myFolder2", respectively
uc -rom "c:\file1.txt" "c:\file2.txt" "c:\result.txt" Invokes a read-only merge of file1.txt and file2.txt - the differences are merged into "result.txt" and the original 2 files are not modified in any way
uc -rom "c:\file1.txt" "c:\file2.txt" "c:\result.txt" Invokes a read-only merge of file1.txt and file2.txt - the differences are merged into "result.txt" and the original 2 files are not modified in any way