Command Line Reference |

Command line executable files

Executable | Meaning
BCompare.exe bcompare | This is the main application. Only one copy will run at a time, regardless of how many windows you have open. If you launch a second copy it will tell the existing copy to start a comparison and exit immediately.
BComp.exe | This is a Win32 GUI program. If launched from a version control system, it should work just fine. If launched from a console window, the console (or batch file) will not wait for it.
BComp.com | This is a Win32 console program. It has to have a console. If you launch it from one (or a batch file) that console will wait for the comparison to complete before returning. If you launch it from a version control system interactively, it will show a console window while it's waiting.
bcomp | Launch this program from a version control system because it will wait for the comparison to complete before returning.

Command line parameters

Notice that each parameter should be enclosed in quotation marks if it might contain a space.

Note Mac and Linux users should use "bcompare" instead of "BCompare.exe".

Parameter | Meaning
Named Session | Opens the specified session in the appropriate view. For example: BCompare.exe "My Session"
Named Workspace | Opens the specified saved workspace. (see also Managing Workspaces) For example: BCompare.exe "My Special Workspace"
Pair of folders | Opens a new Folder Compare view with the specified base folders. For example: BCompare.exe "C:\Left Folder" "C:\Right Folder"
Pair of files | Opens the specified files in the associated file view. For example: BCompare.exe "C:\Left File.ext" "C:\Right File.ext"
3 files | Opens a Text Merge view with the specified files in the left, right, and center panes. For example: BCompare.exe C:\Left.ext C:\Right.ext C:\Center.ext
4 files | Opens a Text Merge view with the specified files in the left, right, center, and output panes. For example: BCompare.exe C:\Left.ext C:\Right.ext C:\Center.ext C:\Output.ext
Script file | Automatically executes a list of commands without using a view. For example: BCompare.exe "@C:\My Script.txt"
Settings package (.bcpkg) | Imports settings from package.
- | Opens stdin in the appropriate view. For example: dir | BCompare.exe -

Command line switches

Note Mac and Linux users should prefix the switches with "-" instead of "/".

Switch | Meaning
/?, /h, /help | Opens the help file to the "Command Line Reference" page. Writes usage information to the console.
/automerge | Automatically merges files without user interaction unless conflicts are found.
/center=<filename> | Explicitly specifies the merge center file.
/closescript | Closes the script window on completion. Overrides the Close when finished setting in Tools > Options > Tweaks > Scripts.
/edit | Opens a Text Edit view.
/expandall | Expands all subfolders during the initial folder comparison.
/favorleft /favorright | Draws non-conflicting changes in the output from the "favored" side without coloring or section lines. For ignored unimportant conflicts, changes are automatically taken from the "favored" side instead of the center.
/filters=<file masks> | Uses the specified name filter for the initial folder comparison. Separate multiple file masks with semi-colons. Surround the name filter with quotes if it contains spaces.
/force | Writes conflicts to the output with CVS-style markers if /automerge is present.
/fv=<type>, /fileviewer=<type> | Opens a new view of the specified type which can be any of: "Text Compare" "Text Merge" "Table Compare" "Hex Compare"

"MP3 Compare"

"Picture Compare"

"Registry Compare"

"Version Compare"

"Folder Compare"

"Folder Merge"

"Folder Sync"

/iu, /ignoreunimportant | Turns on Ignore Unimportant Differences if /automerge is present.
/mergeoutput=<filename> | Explicitly specifies the merge output file.
/nobackups | Prevents the creation of backup files.
/qc=<type>, /quickcompare=<type> | Performs a quick comparison of two files and sets the DOS error level on exit. The specified type can be size, crc, or binary. If a type is not specified, a rules-based comparison will be performed. Error levels are documented below.
/reviewconflicts | Opens a Text Merge view if /automerge is present and conflicts are found.
/ro, /readonly | Disables editing on all sides.
/ro1, /lro, /leftreadonly /ro2, /rro, /rightreadonly | Disables editing on the respective side.
/savetarget=<filename> | Overwrites the specified file instead of original file when the file view's Save command is used.
/silent | Causes all interaction to be suppressed. No Task Bar entry or window will be shown. For settings packages, all settings will be imported. For scripts, any unresolved issue that would normally show a dialog will log an error instead.
/solo | Forces a new instance of the program.
/sync | Opens a Folder Sync view.
/title1=<title>, /lefttitle=<title> /title2=<title>, /righttitle=<title> /title3=<title>, /centertitle=<title> /title4=<title>, /outputtitle=<title> | Shows the specified description in the respective path edit.
/vcs1=<path>, /vcsleft=<path> /vcs2=<path>, /vcsright=<path> /vcs3=<path>, /vcscenter=<path> /vcs4=<path>, /vcsoutput=<path> | Shows the specified version control system path in the respective path edit unless a title has been provided. For a file view, the specified path is also used to pick the appropriate file format.

Return codes

Code | Meaning
0 | Success
1 | Binary same
2 | Rules-based same
11 | Binary differences
12 | Similar
13 | Rules-based differences
14 | Conflicts detected
100 | Unknown error
101 | Conflicts detected, merge output not written
102 | BComp.exe unable to wait until BCompare.exe finishes
103 | BComp.exe cannot find BCompare.exe
104 | Trial period expired
105 | Error loading script file
106 | Script syntax error
107 | Script failed to load folders or files