1 <?xml version="1.0" encoding="UTF-8"?>
2 <article id="Command_line">
3 <title>Command line<indexterm>
4 <primary>command line</primary>
5 </indexterm><indexterm>
6 <primary>WinMerge command line</primary>
8 <see>command line</see>
11 <para>The WinMerge command line accepts several parameters in addition to the
12 paths to compare. Most of these parameters are intended for using WinMerge as
13 an external compare application or starting a compare operation from a batch
16 <para>Use one of these formats for the WinMerge command:</para>
18 <para><cmdsynopsis sepchar=" ">
19 <command>WinMergeU</command>
21 <arg choice="opt" rep="norepeat"><option>/?</option></arg>
24 <para><cmdsynopsis sepchar=" ">
25 <command>WinMergeU</command>
27 <arg choice="opt" rep="norepeat"><option>/r</option></arg>
29 <arg choice="opt" rep="norepeat"><option>/e</option></arg>
31 <arg choice="opt" rep="norepeat"><option>/f</option>
32 <replaceable>filter</replaceable></arg>
34 <arg choice="opt" rep="norepeat"><option>/m</option>
35 <replaceable>compare-method</replaceable></arg>
37 <arg><option>/x</option></arg>
39 <arg><option>/xq</option></arg>
41 <arg><option>/s</option></arg>
43 <arg><option>/sw</option></arg>
45 <arg><option>/s-</option></arg>
47 <arg choice="opt" rep="norepeat"><option>/ul</option></arg>
49 <arg choice="opt" rep="norepeat"><option>/um</option></arg>
51 <arg choice="opt" rep="norepeat"><option>/ur</option></arg>
53 <arg choice="opt" rep="norepeat"><option>/u</option></arg>
55 <arg choice="opt" rep="norepeat"><option>/wl</option></arg>
57 <arg choice="opt" rep="norepeat"><option>/wm</option></arg>
59 <arg choice="opt" rep="norepeat"><option>/wr</option></arg>
61 <arg choice="opt" rep="norepeat"><option>/self-compare</option></arg>
63 <arg><option>/minimize</option></arg>
65 <arg><option>/maximize</option></arg>
67 <arg choice="opt" rep="norepeat"><option>/fl</option></arg>
69 <arg choice="opt" rep="norepeat"><option>/fm</option></arg>
71 <arg choice="opt" rep="norepeat"><option>/fr</option></arg>
73 <arg choice="opt" rep="norepeat"><option>/dl</option>
74 <replaceable>leftdesc</replaceable></arg>
76 <arg choice="opt" rep="norepeat"><option>/dm</option>
77 <replaceable>middledesc</replaceable></arg>
79 <arg choice="opt" rep="norepeat"><option>/dr</option>
80 <replaceable>rightdesc</replaceable></arg>
83 rep="norepeat"><replaceable>leftpath</replaceable></arg>
86 rep="norepeat"><replaceable>middlepath</replaceable></arg>
89 rep="norepeat"><replaceable>rightpath</replaceable></arg>
92 rep="norepeat"><option>/o</option>
93 <replaceable>outputpath</replaceable></arg>
95 <arg choice="opt" rep="norepeat"><option>/al</option></arg>
97 <arg choice="opt" rep="norepeat"><option>/am</option></arg>
99 <arg choice="opt" rep="norepeat"><option>/ar</option></arg>
101 </cmdsynopsis></para>
103 <cmdsynopsis sepchar=" ">
104 <command>WinMergeU</command>
107 rep="norepeat"><replaceable>conflictfile</replaceable></arg>
110 <para>Entering the command with no parameters or pathnames simply opens the
111 WinMerge window. Parameters are prefixed with either a forward slash (
112 <literal>/</literal> ) or dash ( <literal>-</literal> ) character. Pathnames
113 have no prefix character.</para>
117 <term><option>/?</option></term>
119 <para>Opens WinMerge Help at this topic.</para>
125 <primary>recursive folder compare</primary>
127 <term><option>/r</option></term>
129 <para>Compares all files in all subfolders (recursive
130 compare). Unique folders (occurring only on one side) are listed in the
131 compare result as separate items. Note that including subfolders can
132 increase compare time significantly. Without this parameter, WinMerge
133 lists only files and subfolders at the top level of the two target
134 folders. It does not compare the subfolders.</para>
140 <primary>WinMerge window</primary>
141 <secondary>closing</secondary>
144 <term><option>/e</option></term>
146 <para>Enables you to close WinMerge with a single
147 <keycap>Esc</keycap> key press. This is useful when you use WinMerge as an
148 external compare application: you can close WinMerge quickly, like a
149 dialog. Without this parameter, you might have to press
150 <keycap>Esc</keycap> multiple times to close all its windows.</para>
156 <primary>filters</primary>
157 <secondary>applying in command line</secondary>
160 <term><option>/f</option></term>
162 <para>Applies a specified filter to restrict the
163 comparison. The filter can be a filemask like <filename><userinput>*.h
164 *.cpp</userinput></filename>, or the name of a file filter like
165 <userinput>XML/HTML Devel</userinput>. Add quotation marks around a filter
166 mask or name that contains spaces.</para>
172 <primary>compare method</primary>
173 <secondary>applying in command line</secondary>
176 <term><option>/m</option></term>
178 <para>Sets the compare method to use for the comparison.
179 This can be one of the keywords <userinput>Full</userinput>,
180 <userinput>Quick</userinput>, <userinput>Binary</userinput>,
181 <userinput>Date</userinput>, <userinput>SizeDate</userinput>,
182 <userinput>Size</userinput>.</para>
187 <term><option>/x</option></term>
189 <para>Closes WinMerge (after displaying an information
190 dialog) when you start a comparison of identical files. The parameter has
191 no effect after the comparison, for example if the files become identical
192 as a result of merging or editing. This parameter is useful when you use
193 WinMerge as an external compare application, or when you want to eliminate
194 unnecessary steps by ignoring files that don't have any
200 <term><option>/xq</option></term>
202 <para>Is similar to <option>/x</option> but does not
203 show the message about identical files.</para>
209 <primary>WinMerge window</primary>
210 <secondary>limiting instances</secondary>
213 <term><option>/s</option></term>
215 <para>Limits WinMerge windows to a single instance.
216 For example, if WinMerge is already running, a new compare opens in the
217 same instance. Without this parameter, multiple windows are allowed:
218 depending on other settings, a new compare might open in the existing
219 window or in a new window.</para>
224 <term><option>/sw</option></term>
226 <para>Limit the WinMerge window to one instance as well as the option /s.
227 However, it waits for the instance displaying the window to terminate.
233 <term><option>/s-</option></term>
235 <para>Ensure that another instance is always executed, ignoring the
236 value of the "Allow only one instance to run" option.</para>
242 <primary>MRU list</primary>
245 <term><option>/ul</option></term>
247 <para>Prevents WinMerge from adding the left path to
248 the Most Recently Used (MRU) list. External applications should not add
249 paths to the MRU list in the Select Files or Folders dialog.</para>
254 <term><option>/um</option></term>
256 <para>Prevents WinMerge from adding the middle path to
257 the Most Recently Used (MRU) list. External applications should not add
258 paths to the MRU list in the Select Files or Folders dialog.</para>
263 <term><option>/ur</option></term>
265 <para>Prevents WinMerge from adding the right path to
266 the Most Recently Used (MRU) list. External applications should not add
267 paths to the MRU list in the Select Files or Folders dialog.</para>
272 <term><option>/u</option></term>
274 <para>Prevents WinMerge from adding either path (left
275 or right) to the Most Recently Used (MRU) list. External applications
276 should not add paths to the MRU list in the Select Files or Folders
283 <primary>protecting files</primary>
286 <term><option>/wl</option></term>
288 <para>Opens the left side as read-only. Use this when
289 you don't want to change left side items in the compare.</para>
294 <term><option>/wm</option></term>
296 <para>Opens the middle side as read-only. Use this
297 when you don't want to change right side items in the compare.</para>
302 <term><option>/wr</option></term>
304 <para>Opens the right side as read-only. Use this
305 when you don't want to change right side items in the compare.</para>
310 <term><option>/self-compare</option></term>
312 <para>Compares the specified file with a copy of the file.</para>
318 <primary>WinMerge window</primary>
319 <secondary>opening minimized or maximized</secondary>
322 <term><option>/minimize</option></term>
324 <para>Starts WinMerge as a minimized window.
325 This option can be useful during lengthy compares.</para>
330 <term><option>/maximize</option></term>
332 <para>Starts WinMerge as a maximized
338 <term><option>/fl</option></term>
340 <para>Sets focus to the left side at startup.</para>
345 <term><option>/fm</option></term>
347 <para>Sets focus to the middle side at startup.</para>
352 <term><option>/fr</option></term>
354 <para>Sets focus to the right side at startup.</para>
359 <term><option>/dl</option></term>
361 <para>Specifies a description in the left side title
362 bar, overriding the default folder or filename text. For example:
363 <userinput>/dl "Version 1.0</userinput>" or <userinput>/dl
364 WorkingCopy</userinput>. Use quotation marks around descriptions that
365 contain spaces.</para>
370 <term><option>/dm</option></term>
372 <para>Specifies a description in the middle side title
373 bar, just like <option>/dl</option>.</para>
378 <term><option>/dr</option></term>
380 <para>Specifies a description in the right side title
381 bar, just like <option>/dl</option>.</para>
386 <term><option>leftpath</option></term>
388 <para>Specifies the folder, file or project file to open on the left side.</para>
393 <term><option><replaceable>middlepath</replaceable></option></term>
395 <para>Specifies the folder, file or project file to open on the middle side.</para>
400 <term><option><replaceable>rightpath</replaceable></option></term>
402 <para>Specifies the folder, file or project file to open on the right side.</para>
404 <para>WinMerge cannot compare files to folders, so the path parameters
405 (<option><replaceable>leftpath</replaceable></option>,
406 <option><replaceable>middlepath</replaceable></option> and
407 <option><replaceable>rightpath</replaceable></option>) must point to the
408 same target type (either folders or files). If WinMerge cannot find either
409 of the specified paths, it opens the Select Files or Folders dialog, where
410 you can browse for the correct paths.</para>
413 <para>In file comparisons, you can specify a folder name in one of the
414 path parameters, as long as the folder contains a file with the same
415 name as the one specified in the other, file path.</para>
417 <para>For example, consider this command:</para>
419 <para><userinput>WinMergeU <filename>C:\Folder\File.txt</filename>
420 <filename class="directory">C:\Folder2</filename> </userinput></para>
422 <para>If <filename class="directory">C:\Folder2</filename> contains a
423 file named <filename>File.txt</filename>: WinMerge implicitly resolves
424 the second path as a file specification, and compares the two files. Of
425 course, the command is invalid if <filename
426 class="directory">C:\Folder2</filename> does <emphasis>not</emphasis>
427 contain a file named <filename>File.txt</filename>.</para>
435 <primary>merging differences</primary>
436 <secondary>result file</secondary>
439 <term><option>/o <replaceable>outputpath</replaceable></option></term>
441 <para>Specifies an optional output folder where you want merged result files to be
444 <para>The output path is rarely needed when you start WinMerge from
445 the command line. It is meant to be used with version control tools, where
446 you might need to specify a output path for the
447 <wordasword>result</wordasword> file. If you specify a output path,
448 WinMerge still shows only two or three files in the File Compare window. However,
449 if you save either of these files, it is written to the output path,
450 leaving the two or three source files intact.</para>
452 <para>Version control systems typically refer to the source and result
453 files using terms like <glossterm>theirs</glossterm>,
454 <glossterm>mine</glossterm>, and either <glossterm>merged</glossterm> or
455 <glossterm>resolved</glossterm>. If you specify a output path on the
456 WinMerge command line, and are working with a version control system, you
457 should list the files in that order.</para>
462 <term><option>/al</option></term>
464 <para>Auto-merges at the left side at startup.</para>
469 <term><option>/am</option></term>
471 <para>Auto-merges at the middle side at startup.</para>
476 <term><option>/ar</option></term>
478 <para>Auto-merges at the right side at startup.</para>
484 <primary>conflict files</primary>
485 <secondary>specifying on command line</secondary>
488 <term><option><replaceable>conflictfile</replaceable></option></term>
490 <para>Specifies a conflict file, typically generated by a Version control system. The
491 conflict file opens in the File Compare window, where you can merge and
492 resolve conflicts, as described in <xref
493 linkend="ResolveConflictFiles" />. Note that no other paths can be used
494 with a conflict file.</para>