WinMerge accepts several parameters from command line, in addition to
paths to compare. Most of these parameters are are intended for using
WinMerge as an external compare application. Or for starting from batch
files.
Syntax for the command line is:
WinMerge [/r] [/e] [/f filter] [/x] [/s] [/ul] [/ur] [/ub] [/wl] [/wr] [/minimize] [/dl leftdesc] [/dr rightdesc] leftpath rightpath [outputpath]
All parameters start with "/" or with "-" prefix character. Pathnames
don't have any prefix character.
- /? displays the most commonly used parameters
as help dialog.
- /r tells WinMerge to compare folders
recursively . Normally WinMerge does not compare subfolder contents but
does the "flat" compare showing the files in compared folders and
subfolders as separate items. Using /r tells WinMerge to compare all
files in all subfolders. When subfolders are included, only unique
subfolders are visible as separate items in compare results. Note that
including subfolders can increase compare time remarkably.
- /e allows WinMerge to be closed with a single
Esc keypress. This is useful when using WinMerge as an
external compare application. WinMerge can act like an dialog which is
easy and fast to close.
- /f allows selecting filter used. Filter can be
filemask like "*.h *.cpp" or name of filefilter
like "XML/HTML Devel". Quotation marks must be used
if filter mask or name contains spaces.
- /x closes WinMerge after information dialog
when files are identical. This parameter is useful when WinMerge is used
as an external compare application. It helps to faster process and/or
ignore files which don't have any differences.
- /s enables single-instance behavior. If there
is already WinMerge running new compare is opened to that same instance.
Depending on other settings (if multiple windows are allowed) new
compare is opened to existing or new window.
- /ul tells WnMerge to not add left path to MRU.
External applications should not add paths to Open-dialog's MRU
lists.
- /ur tells WinMerge to not add right path to
MRU. External applications should not add paths to Open-dialog's MRU
lists.
- /ub tells WinMerge to not add both paths to
MRU. External applications should not add paths to Open-dialog's MRU
lists.
- /wl initially opens left side as read-only.
Use this when you don't want to change left-side items in
compare.
- /wr initially opens right side as read-only.
Use this when you don't want to change right-side items in
compare.
- /minimize starts WinMerge as minimized. This
option can be used to start WinMerge minimized for lenghty
compares.
- /dl adds a description for left side shown
instead of folder / filename. This allows showing version number or
label for compared items. Like "Version 1.0" or "Work Copy".
- /dr adds a description for right side shown
instead of folder / filename. This allows showing version number or
label for compared items. Like "Version 1.0" or "Work Copy".
- leftpath is the folder or filename
to open on the left side.
- rightpath is the folder or filename
to open on the right side.
- outputpath is an optional output
folder where you want merged files to be saved.
![[Note]](images/note.gif) |
Note |
leftpath and
rightpath have to both be files or both be
folders.
|
If both paths are not files or folders or one of paths is non-existent
WinMerge shows the Open-dialog for user to choose proper paths to
open.