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 choice="opt" rep="norepeat"><option>/t</option>
38 <replaceable>window-type</replaceable></arg>
40 <arg><option>/x</option></arg>
42 <arg><option>/xq</option></arg>
44 <arg><option>/s</option></arg>
46 <arg><option>/sw</option></arg>
48 <arg><option>/s-</option></arg>
50 <arg choice="opt" rep="norepeat"><option>/ul</option></arg>
52 <arg choice="opt" rep="norepeat"><option>/um</option></arg>
54 <arg choice="opt" rep="norepeat"><option>/ur</option></arg>
56 <arg choice="opt" rep="norepeat"><option>/u</option></arg>
58 <arg choice="opt" rep="norepeat"><option>/wl</option></arg>
60 <arg choice="opt" rep="norepeat"><option>/wm</option></arg>
62 <arg choice="opt" rep="norepeat"><option>/wr</option></arg>
64 <arg choice="opt" rep="norepeat"><option>/self-compare</option></arg>
66 <arg><option>/minimize</option></arg>
68 <arg><option>/maximize</option></arg>
70 <arg choice="opt" rep="norepeat"><option>/fl</option></arg>
72 <arg choice="opt" rep="norepeat"><option>/fm</option></arg>
74 <arg choice="opt" rep="norepeat"><option>/fr</option></arg>
76 <arg choice="opt" rep="norepeat"><option>/l</option>
77 <replaceable>linenumber</replaceable></arg>
79 <arg choice="opt" rep="norepeat"><option>/table-delimiter</option>
80 <replaceable>delimiter</replaceable></arg>
82 <arg choice="opt" rep="norepeat"><option>/dl</option>
83 <replaceable>leftdesc</replaceable></arg>
85 <arg choice="opt" rep="norepeat"><option>/dm</option>
86 <replaceable>middledesc</replaceable></arg>
88 <arg choice="opt" rep="norepeat"><option>/dr</option>
89 <replaceable>rightdesc</replaceable></arg>
91 <arg choice="opt" rep="norepeat"><option>/al</option></arg>
93 <arg choice="opt" rep="norepeat"><option>/am</option></arg>
95 <arg choice="opt" rep="norepeat"><option>/ar</option></arg>
97 <arg choice="opt" rep="norepeat"><option>/noninteractive</option></arg>
99 <arg choice="opt" rep="norepeat"><option>/noprefs</option></arg>
101 <arg choice="opt" rep="norepeat"><option>/ignorews</option></arg>
103 <arg choice="opt" rep="norepeat"><option>/ignoreblanklines</option></arg>
105 <arg choice="opt" rep="norepeat"><option>/ignorecase</option></arg>
107 <arg choice="opt" rep="norepeat"><option>/ignoreeol</option></arg>
109 <arg choice="opt" rep="norepeat"><option>/ignorecodepage</option></arg>
111 <arg choice="opt" rep="norepeat"><option>/ignorecomments</option></arg>
113 <arg choice="opt" rep="norepeat"><option>/unpacker</option>
114 <replaceable>unpacker-name</replaceable></arg>
116 <arg choice="opt" rep="norepeat"><option>/prediffer</option>
117 <replaceable>prediffer-name</replaceable></arg>
119 <arg choice="opt" rep="norepeat"><option>/cp</option>
120 <replaceable>codepage</replaceable></arg>
122 <arg choice="opt" rep="norepeat"><option>/cfg</option>
123 <replaceable>name=value</replaceable></arg>
125 <arg choice="opt" rep="norepeat"><option>/inifile</option>
126 <replaceable>inifile</replaceable></arg>
129 rep="norepeat"><replaceable>leftpath</replaceable></arg>
132 rep="norepeat"><replaceable>middlepath</replaceable></arg>
135 rep="norepeat"><replaceable>rightpath</replaceable></arg>
138 rep="norepeat"><option>/o</option>
139 <replaceable>outputpath</replaceable></arg>
142 rep="norepeat"><option>/or</option>
143 <replaceable>reportpath</replaceable></arg>
145 </cmdsynopsis></para>
147 <cmdsynopsis sepchar=" ">
148 <command>WinMergeU</command>
151 rep="norepeat"><replaceable>conflictfile</replaceable></arg>
154 <para>Entering the command with no parameters or pathnames simply opens the
155 WinMerge window. Parameters are prefixed with either a forward slash (
156 <literal>/</literal> ) or dash ( <literal>-</literal> ) character. Pathnames
157 have no prefix character.</para>
161 <term><option>/?</option></term>
163 <para>Opens WinMerge Help at this topic.</para>
169 <primary>recursive folder compare</primary>
171 <term><option>/r</option></term>
173 <para>Compares all files in all subfolders (recursive
174 compare). Unique folders (occurring only on one side) are listed in the
175 compare result as separate items. Note that including subfolders can
176 increase compare time significantly. Without this parameter, WinMerge
177 lists only files and subfolders at the top level of the two target
178 folders. It does not compare the subfolders.</para>
184 <primary>WinMerge window</primary>
185 <secondary>closing</secondary>
188 <term><option>/e</option></term>
190 <para>Enables you to close WinMerge with a single
191 <keycap>Esc</keycap> key press. This is useful when you use WinMerge as an
192 external compare application: you can close WinMerge quickly, like a
193 dialog. Without this parameter, you might have to press
194 <keycap>Esc</keycap> multiple times to close all its windows.</para>
200 <primary>filters</primary>
201 <secondary>applying in command line</secondary>
204 <term><option>/f</option></term>
206 <para>Applies a specified filter to restrict the
207 comparison. The filter can be a filemask like <filename><userinput>*.h
208 *.cpp</userinput></filename>, or the name of a file filter like
209 <userinput>XML/HTML Devel</userinput>. Add quotation marks around a filter
210 mask or name that contains spaces.</para>
216 <primary>compare method</primary>
217 <secondary>applying in command line</secondary>
220 <term><option>/m <replaceable>compare-method</replaceable></option></term>
222 <para>Sets the compare method to use for the comparison.
223 This can be one of the keywords <userinput>Full</userinput>,
224 <userinput>Quick</userinput>, <userinput>Binary</userinput>,
225 <userinput>Date</userinput>, <userinput>SizeDate</userinput> or
226 <userinput>Size</userinput>.</para>
232 <primary>window type</primary>
233 <secondary>applying in command line</secondary>
236 <term><option>/t <replaceable>window-type</replaceable></option></term>
238 <para>Specifies the type of window in which to display files.
239 This can be one of the keywords <userinput>Text</userinput>,
240 <userinput>Table</userinput>, <userinput>Binary</userinput> or
241 <userinput>Image</userinput>.</para>
246 <term><option>/x</option></term>
248 <para>Closes WinMerge (after displaying an information
249 dialog) when you start a comparison of identical files. The parameter has
250 no effect after the comparison, for example if the files become identical
251 as a result of merging or editing. This parameter is useful when you use
252 WinMerge as an external compare application, or when you want to eliminate
253 unnecessary steps by ignoring files that don't have any
259 <term><option>/xq</option></term>
261 <para>Is similar to <option>/x</option> but does not
262 show the message about identical files.</para>
268 <primary>WinMerge window</primary>
269 <secondary>limiting instances</secondary>
272 <term><option>/s</option></term>
274 <para>Limits WinMerge windows to a single instance.
275 For example, if WinMerge is already running, a new compare opens in the
276 same instance. Without this parameter, multiple windows are allowed:
277 depending on other settings, a new compare might open in the existing
278 window or in a new window.</para>
283 <term><option>/sw</option></term>
285 <para>Limit the WinMerge window to one instance as well as the option /s.
286 However, it waits for the instance displaying the window to terminate.
292 <term><option>/s-</option></term>
294 <para>Ensure that another instance is always executed, ignoring the
295 value of the "Allow only one instance to run" option.</para>
301 <primary>MRU list</primary>
304 <term><option>/ul</option></term>
306 <para>Prevents WinMerge from adding the left path to
307 the Most Recently Used (MRU) list. External applications should not add
308 paths to the MRU list in the Select Files or Folders dialog.</para>
313 <term><option>/um</option></term>
315 <para>Prevents WinMerge from adding the middle path to
316 the Most Recently Used (MRU) list. External applications should not add
317 paths to the MRU list in the Select Files or Folders dialog.</para>
322 <term><option>/ur</option></term>
324 <para>Prevents WinMerge from adding the right path to
325 the Most Recently Used (MRU) list. External applications should not add
326 paths to the MRU list in the Select Files or Folders dialog.</para>
331 <term><option>/u</option></term>
333 <para>Prevents WinMerge from adding either path (left
334 or right) to the Most Recently Used (MRU) list. External applications
335 should not add paths to the MRU list in the Select Files or Folders
342 <primary>protecting files</primary>
345 <term><option>/wl</option></term>
347 <para>Opens the left side as read-only. Use this when
348 you don't want to change left side items in the compare.</para>
353 <term><option>/wm</option></term>
355 <para>Opens the middle side as read-only. Use this
356 when you don't want to change right side items in the compare.</para>
361 <term><option>/wr</option></term>
363 <para>Opens the right side as read-only. Use this
364 when you don't want to change right side items in the compare.</para>
369 <term><option>/self-compare</option></term>
371 <para>Compares the specified file with a copy of the file.</para>
377 <primary>WinMerge window</primary>
378 <secondary>opening minimized or maximized</secondary>
381 <term><option>/minimize</option></term>
383 <para>Starts WinMerge as a minimized window.
384 This option can be useful during lengthy compares.</para>
389 <term><option>/maximize</option></term>
391 <para>Starts WinMerge as a maximized
397 <term><option>/fl</option></term>
399 <para>Sets focus to the left side at startup.</para>
404 <term><option>/fm</option></term>
406 <para>Sets focus to the middle side at startup.</para>
411 <term><option>/fr</option></term>
413 <para>Sets focus to the right side at startup.</para>
418 <term><option>/l <replaceable>linenumber</replaceable></option></term>
420 <para>Specifies a line number to jump to after loading the files.</para>
425 <term><option>/table-delimiter <replaceable>delimiter</replaceable></option></term>
427 <para>Specifies a delimiter character for table editing.</para>
432 <term><option>/dl</option></term>
434 <para>Specifies a description in the left side title
435 bar, overriding the default folder or filename text. For example:
436 <userinput>/dl "Version 1.0</userinput>" or <userinput>/dl
437 WorkingCopy</userinput>. Use quotation marks around descriptions that
438 contain spaces.</para>
443 <term><option>/dm</option></term>
445 <para>Specifies a description in the middle side title
446 bar, just like <option>/dl</option>.</para>
451 <term><option>/dr</option></term>
453 <para>Specifies a description in the right side title
454 bar, just like <option>/dl</option>.</para>
459 <term><option>/al</option></term>
461 <para>Auto-merges at the left side at startup.</para>
466 <term><option>/am</option></term>
468 <para>Auto-merges at the middle side at startup.</para>
473 <term><option>/ar</option></term>
475 <para>Auto-merges at the right side at startup.</para>
480 <term><option>/noninteractive</option></term>
487 <term><option>/noprefs</option></term>
494 <term><option>/ignorews</option></term>
501 <term><option>/ignoreblanklines</option></term>
508 <term><option>/ignorecase</option></term>
515 <term><option>/ignoreeol</option></term>
522 <term><option>/ignorecodepage</option></term>
529 <term><option>/ignorecomments</option></term>
536 <term><option>/unpacker</option></term>
543 <term><option>/prediffer</option></term>
550 <term><option>/cp</option></term>
557 <term><option>/cfg</option></term>
564 <term><option><replaceable>leftpath</replaceable></option></term>
566 <para>Specifies the folder, file or project file to open on the left side.</para>
571 <term><option><replaceable>middlepath</replaceable></option></term>
573 <para>Specifies the folder, file or project file to open on the middle side.</para>
578 <term><option><replaceable>rightpath</replaceable></option></term>
580 <para>Specifies the folder, file or project file to open on the right side.</para>
582 <para>WinMerge cannot compare files to folders, so the path parameters
583 (<option><replaceable>leftpath</replaceable></option>,
584 <option><replaceable>middlepath</replaceable></option> and
585 <option><replaceable>rightpath</replaceable></option>) must point to the
586 same target type (either folders or files). If WinMerge cannot find either
587 of the specified paths, it opens the Select Files or Folders dialog, where
588 you can browse for the correct paths.</para>
591 <para>In file comparisons, you can specify a folder name in one of the
592 path parameters, as long as the folder contains a file with the same
593 name as the one specified in the other, file path.</para>
595 <para>For example, consider this command:</para>
597 <para><userinput>WinMergeU <filename>C:\Folder\File.txt</filename>
598 <filename class="directory">C:\Folder2</filename> </userinput></para>
600 <para>If <filename class="directory">C:\Folder2</filename> contains a
601 file named <filename>File.txt</filename>: WinMerge implicitly resolves
602 the second path as a file specification, and compares the two files. Of
603 course, the command is invalid if <filename
604 class="directory">C:\Folder2</filename> does <emphasis>not</emphasis>
605 contain a file named <filename>File.txt</filename>.</para>
613 <primary>merging differences</primary>
614 <secondary>result file</secondary>
617 <term><option>/o <replaceable>outputpath</replaceable></option></term>
619 <para>Specifies an optional output folder where you want merged result files to be
622 <para>The output path is rarely needed when you start WinMerge from
623 the command line. It is meant to be used with version control tools, where
624 you might need to specify a output path for the
625 <wordasword>result</wordasword> file. If you specify a output path,
626 WinMerge still shows only two or three files in the File Compare window. However,
627 if you save either of these files, it is written to the output path,
628 leaving the two or three source files intact.</para>
630 <para>Version control systems typically refer to the source and result
631 files using terms like <glossterm>theirs</glossterm>,
632 <glossterm>mine</glossterm>, and either <glossterm>merged</glossterm> or
633 <glossterm>resolved</glossterm>. If you specify a output path on the
634 WinMerge command line, and are working with a version control system, you
635 should list the files in that order.</para>
640 <term><option>/or</option></term>
648 <primary>conflict files</primary>
649 <secondary>specifying on command line</secondary>
652 <term><option><replaceable>conflictfile</replaceable></option></term>
654 <para>Specifies a conflict file, typically generated by a Version control system. The
655 conflict file opens in the File Compare window, where you can merge and
656 resolve conflicts, as described in <xref
657 linkend="ResolveConflictFiles" />. Note that no other paths can be used
658 with a conflict file.</para>
664 <primary>ini file</primary>
665 <secondary>specifying on command line</secondary>
668 <term><option>/inifile <replaceable>inifile</replaceable></option></term>
670 <para>specifies an INI file used to load and save settings instead of the registry.</para>