IDM PowerTips

UltraCompare command line options

UltraCompare includes support for command line access, allowing you to automate compares with output information or integrate UltraCompare with your other applications, version control, etc. We will go over all command line parameters for UltraCompare’s different compare modes in the following sections:

Basic command line format rules

The order and format of how these options are used is important. There are a few rules to remember when using UltraCompare’s command line functionality:

  1. All parameters must be separated by a space.
  2. “Compare mode selector” switches such as -t, -3, -p, -x, -d, and -w must always immediately precede the compared file(s)/folder(s) paths. Any other switches, e.g. -o, -ne, -a, -title1, -ignt, -horz, etc should follow the compared file(s)/folder(s) paths or should precede the mode selector switch.
  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 OPTIONS] [MODE SELECTOR] [COMPARED FILE/FOLDER PATHS] [COMPARE OPTIONS] [OUTPUT FILE PATH]

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>

Result file output format

As of UltraCompare 2022.2, append a .html file extension to your output file path to generate an HTML based result report. All other extensions will generate a plain-text result report.

File / text mode compare parameters

As of UltraCompare 2022.2, append a .html file extension to your output file path to generate an HTML based result report. All other extensions will generate a plain-text result report.

Parameter Type Meaning
-t Mode selector invokes text compare mode
-3 Mode selector invokes text compare of 3 files
-qc Mode selector invokes quick diff check (application does not open - see "Quick Difference" power tip)
-a Compare option enables "Show all" (both differences and similarities are displayed)
-m Compare option enables "Show matching" (only similar lines are displayed)
-ne Compare option enables "Show differences" (only different lines are displayed)
-B Compare option enables "Ignore blank lines" option
-b Compare option enables "Ignore whitespace" option
-i Compare option enables "Ignore case" option
-lt Compare option enables "Ignore line terminators" option
-ignb "STRING" Compare option enables "Ignore lines that begin with STRING" option
-ignc "STRING" Compare option enables "Ignore lines that contain STRING" option
-igne "STRING" Compare option enables "Ignore lines that end with STRING" option
-ignbtw "STRING1" "STRING2" Compare option enables "Ignore all text between STRING1 and STRING2" option
-ignfb "#" Compare option enables "Ignore # lines at start of file" option
-ignte "#" Compare option enables "Ignore # lines at end of file" option
-rio Compare option resets (clears) ignore options – defaults will be used
-ofa Result file option creates result file in "All frames" format
-ofc Result file option creates result file in "Differences in context" format
-ofo Result file option creates result file in "One frame only" format
-ofs Result file option creates result file in "Side by side" format
-rom Compare option enables "read-only" merge mode (original compared files aren't altered, and merged changes are saved into separate third file)

Examples:

Text compare with output:
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

3-way text compare with output:
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

Text compare with options and output:
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 whitespace”, and “Ignore blank lines” set, and will only report differences in output file c:\output.txt

Text compare with advanced ignore options:
uc -t "c:\file.c" "c:\file2.c" -ignbtw "/*" "*/"
Invokes a text compare of file.c and file.c, ignoring all text between /* and */ (comments)

Read-only merge:
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

Text compare with horizontal layout:
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

Binary mode compare parameters

Parameter Type Meaning
-p Mode selector invokes fast binary (hex) compare of files
-x Mode selector invokes smart binary (hex) compare of files

Example:

Binary compare with output:
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

Folder mode compare parameters

Parameter Type Meaning
-d Mode selector invokes folder mode compare
-w Mode selector invokes 3-way folder mode compare
-dmb Compare option sets folder compare type to "Basic" (only file sizes and timestamps are compared)
-dmf Compare option sets folder compare type to "Full" (files are compared byte-by-byte)
-dms Compare option sets folder compare type to "Smart" (file contents are compared based upon text mode settings and ignore options)
-r Compare option enables recursive mode (all subfolders and files are included in compare)
-fb Compare option forces a binary comparison of all files in a folder compare (only to be used when invoking a "Smart" folder compare)
-ft Compare option forces a text comparison of all files in a folder compare (only to be used when invoking a "Smart" folder compare)
-ignt Compare option enables "Ignore timestamp differences" option
-a Compare option enables "Show all" (both differences and similarities are displayed)
-m Compare option enables "Show matching" (only similar lines are displayed)
-ne Compare option enables "Show differences" (only different lines are displayed)

Examples

Basic folder compare with output:
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

Smart, recursive, 3-way folder compare with output:
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

Smart, recursive folder compare with aliases:
uc -d -dms -r "c:\dir1" "c:\dir2" -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

Table/Excel mode compare parameters

Parameter Type Meaning
-tb Mode selector invokes table mode compare
-mc Compare option sets "Show matching columns" display option
-mr Compare option sets "Show matching rows" display option
-nec Compare option sets "Show different columns" display option
-ner Compare option sets "Show different rows" display option

Examples

Table compare with differing columns:
uc -tb "c:\temp\file1.xls" "c:\temp\file2.xls" -nec
Invokes an Excel compare with only different columns displayed

Git compare / merge parameters

Parameter Type Meaning
-gitdt Mode selector invokes Git diff mode
-gitm Mode selector invokes Git merge mode

Examples:

Git diff (used for “difftool” in .gitconfig):
uc -gitdt "$REMOTE" "$LOCAL" "$MERGED"-title1 "REMOTE" -title2 "LOCAL"
Invokes a diff of local changes against repository version using aliases “REMOTE” and “LOCAL”

Git merge (used for “mergetool” in .gitconfig):
uc -gitm "$REMOTE" "$LOCAL" "$BASE" "$MERGED"-title1 "REMOTE" -title2 "LOCAL"
Invokes a merge / conflict resolution in a special “Git merge” mode using aliases “REMOTE” and “LOCAL”

Other / miscellaneous compare parameters

Parameter Type Meaning
-prf "SessionName" Compare option runs saved compare session named SessionName
-o Output file option creates output file
-op Output file option appends output of compare to specified (existing) output file
-esc Display option sets UltraCompare to be dismissed when ESC key is pressed
-horz Display option sets view of compare frames to horizontal layout
-vert Display option sets view of compare frames to vertical layout
-title1 / -title2 / -title3 Display option sets alias or title name for the first / second / third file or folder

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.