Home » Products » UltraCompare » Getting Started

Command Line Options

Command line parameters allow users to invoke UltraCompare Professional from a command prompt and specify options related to the compare.  Please note: It is not possible to invoke UltraCompare Lite from the command line.  

 

There are certain rules that must be observed when building a command line string:

 

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).

 

3. Logical units can appear in any order on the command line so long as they are paired with their related parameters:

 

Correct: uc -i -lt -B -b -t <path1> <path2> -o <output file path>

 

Incorrect: uc -t -i -o -lt -B -b <path1> <path2> <output file path>

 

The following command line parameters may be used to invoke UltraCompare Professional from the command line:

 

-3

3-way text compare mode

-a

sets Show All

-B

ignore blank lines in text compare mode

-b

ignore spaces in text compare mode

-d

folder compare mode

-dmb

sets Folder Compare type to Basic

-dmf

sets Folder Compare type to Full

-dms

sets Folder Compare type to Smart

-fb

force all files to be compared as binary in folder compare mode

-ft

force all files to be compared as text in folder compare mode

-horz

sets view to horizontal layout

-i

ignore case in text compare mode

-lt

ignore line terminators

-m

sets Show Matching

-ne

sets Show Differences

-o

creates output file

-op

appends output to specified file

-p

fast binary compare mode

-qc

quick difference check performs a byte by byte check until the first difference is detected

-r

compare folders recursively in folder compare mode

-rio

reset ignore options

-rom

read only merge mode

-t

text compare mode

-title1

sets alias/title name for file/folder in first pane

-title2

sets alias/title name for file/folder in second pane

-title3

sets alias/title name for file/folder in third pane

-vert

sets view to vertical layout

-w

3-way folder compare mode

-x

smart binary compare mode

 

Compare Output Options

It is possible to invoke UltraCompare from the command line and generate an output file.  For example, if the following syntax is used:

 

uc - t " c:\temp\test1\test1.txt" " c:\temp\test2\test2.txt" - o " c:\ temp\output.txt"

 

then the files named "test1.txt" and "test2.txt" would be compared and the output would be written to the "output.txt" file automatically.

 

If this syntax is used:

 

uc -3 " c:\temp\test1\test1.txt" " c:\temp\test2\test2.txt" " c:\temp\test3\test3.txt" - o " c:\ temp\output.txt"

 

then the files named "test1.txt", "test2.txt" and "test3.txt" would be compared and the output would be written to the "output.txt" file automatically.

 

The same may be done for folder compares using similar syntax as described above, i.e.:

 

uc -dmb -d "c:\temp\test1" "c:\temp\test2" -o "c:\temp\output.txt"

 

or

 

uc -dms -w "c:\temp\test1" "c:\temp\test2" "c:\temp\test3" -o "c:\temp\output.txt"

 

If desired, users may specify that output should be appended to an existing file rather than creating a new output file.  This would be specified using the "-op" parameter.  For example:

 

uc -t " c:\temp\test1\test1.txt" " c:\temp\test2\test2.txt" -op " c:\ temp\output.txt"

 

would append the output of the specified compare to the end of the "output.txt" file.

 

Text-Specific Compare Options

The Quick Difference Check "-qc" and Read Only Merge Mode "-rom" operators are exclusively text compare options, so the "-t" option is not required.  For example:

 

uc -qc <path1> <path2>

 

would cause UltraCompare Professional to compare the two files specified.  A byte by byte check will be performed until the first difference is detected.  If a difference is detected the application returns a status of ‘different’ otherwise the application returns ‘same’.

 

Due to the fact that windows programs don't have a stdin, stdout, and stderr, an executable called uc.com is created to pass information back to the command line.  In order to use this feature in the windows shell type the name of the executable "uc" (or "uc.com") with the proper command line arguments.  The com file will execute, load uc.exe, pass the command line, and set up a communications channel with the application.  This allows the user to receive a same or different message when executing the quick difference command line option.  This is the same method used by MSDEV to communicate with the command line.  

 

For Read Only Merge Mode the following syntax must be used:

 

uc -rom  <path1> <path2> <path3>

 

<path1> and <path2> specify the files that are to be compared, but the intent is not to modify the original files at all during the compare/merge process.  The file specified in <path1>  will be copied to <path3> for comparison/merge.  The file specified with <path3> will be displayed in the left pane and the file specified with <path2> will be displayed in the right pane.  

 

Please note: It will only be possible to merge into the document specified with <path3>.  The file this is being compared to will be locked as Read Only.

 

Folder-Specific Compare Options

The -dmb, -dmf, and -dms switches may be used to specify the type of folder compare that should be executed.  For example:

 

uc -dmb -d "c:\temp\test1" "c:\temp\test2"

 

would invoke a Basic folder compare of the specified folders, while:

 

uc -dms -r -w "c:\temp\test1" "c:\temp\test2" "c:\temp\test3"

 

would invoke a recursive Smart folder compare of the specified directories.  When performing a Smart folder mode compare, users can force UltraCompare to consider all included files to be text files (-ft) or binary files (-fb) as follows:

 

uc -ft -dms -d "c:\temp\test1" "c:\temp\test2"

 

or

 

uc -fb -dms -w "c:\temp\test1" "c:\temp\test2" "c:\temp\test3"

 

Please note: These options (-ft and -fb) should only be used when invoking a Smart folder compare (-dms).

 

Ignore Options

Users may specify ignore options from the command line which may be used to refine the data returned from comparison of specified files/folders.  For example:

 

uc -i -B -t "c:\temp\test1.txt" "c:\temp\test2.txt"

 

would invoke a text compare of the specified files while ignoring case differences as well as blank lines that might occur in either file.  It is important to note that ignore options are not automatically reset when different commands are invoked, so if an ignore option is set, it will be inherited by the next command invoked.  This means that if this command is executed:

 

uc -b -t "c:\temp\test1.txt" "c:\temp\test2.txt"

 

then a text compare would be invoked while ignoring whitespace that might occur in the files being compared.  If this command is executed immediately following the completion of that command:

 

uc -lt -t "c:\temp\test1.txt" "c:\temp\test2.txt"

 

then both line terminators and whitespace would be ignored by the comparison.  Users may reset ignore options by using the -rio switch, e.g.:

 

uc -rio -B -b -t "c:\temp\test1.txt" "c:\temp\test2.txt" -o "c:\temp\output.txt"

 

Display Options

Users may specify which differences are shown when the comparison is displayed in UltraCompare using the parameters -a, -m, or -ne.  For example:

 

uc -dmb -d "c:\temp\test1.txt" "c:\temp\test2.txt" -ne

 

would invoke a folder compare of the specified folders, but would only display files and folders that are different when displaying the results of the comparison.  The layout used to display the comparison results may also be specified from the command line using the switches -vert and -horz.  For example:

 

uc -t "c:\temp\test1.txt" "c:\temp\test2.txt" -horz

 

would invoke a text compare of the specified files and would force the results to be displayed in a horizontally tiled layout.

 

Alias/Title Options

Some version control systems require that aliases, rather than full paths for the actual files/folders being compared, be used when invoking a compare of members of the version controlled repository.  The following syntax may be used to support this requirement:

 

uc -t "c:\dev\workingFiles\appData.cpp" "c:\dev\workingFiles\appData.cpp" -title1 "appData1" -title2 "appData2"

 

In this case, the specified files would be compared, but only "appData1" and "appData2" would be displayed for the paths of the compared files when the result is displayed in UltraCompare Professional.

Attachments
There are no attachments for this article.
Related Articles
Registering UltraCompare
Viewed 4176 times since Wed, Sep 21, 2011
Using UltraCompare
Viewed 4971 times since Wed, Sep 21, 2011
3-Way Difference Navigation
Viewed 1673 times since Wed, Sep 21, 2011
Version Control Support
Viewed 2911 times since Wed, Sep 21, 2011
3-Way Folder Navigation
Viewed 1615 times since Wed, Sep 21, 2011
Context Menu Options
Viewed 2233 times since Wed, Sep 21, 2011
Session Properties
Viewed 2089 times since Wed, Sep 21, 2011
Synchronize Folders
Viewed 2607 times since Wed, Sep 21, 2011
Workspace Manager
Viewed 2444 times since Wed, Sep 21, 2011
UltraCompare Versions
Viewed 1772 times since Wed, Sep 21, 2011