getting WinMerge to work as diff tool

Feb 28, 2011 at 11:13 PM

I was excited to try out the External Diff Tool Command but I hit a snag.

I'm using the basic template given for  the diff tool ( I only modified file location for WinMerge)

"F:\Program Files (x86)\WinMerge\WinMergeU.exe" -e -x -u -wl -dl "$(BaseName)" -dr "$(MineName)" "$(base)" "$(mine)"

but when WinMerge dialog comes up it is trying to compare:


C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\$(base)


C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\$(mine)

Any ideas?

p.s. KDiff3 worked when I picked that as a template

Feb 28, 2011 at 11:18 PM

I found the bug.  Should be capitals

"$(ProgramFiles)\WinMerge\WinMergeU.exe" -e -x -u -wl -dl "$(BaseName)" -dr "$(MineName)" "$(base)" "$(mine)"


"$(ProgramFiles)\WinMerge\WinMergeU.exe" -e -x -u -wl -dl "$(BaseName)" -dr "$(MineName)" "$(Base)" "$(Mine)"

Maybe someone familiar with the codeset can check in the change.

Looks like WinMerge is the only bad one :)


Feb 28, 2011 at 11:24 PM

Hmm.. I'm going crazy.. I thought I saw it work once, but now I'm not having any luck.

Switching back to kDiff3

Mar 1, 2011 at 2:45 AM

I didn't have much luck getting it to work with Beyond Compare or CodeCompare either. Kdiff3 works fine. I didn't have time to mess about much so I'll look into it further soon.

Mar 1, 2011 at 3:01 PM
Edited Mar 1, 2011 at 3:12 PM


The following template should work for WinMerge.

"$(ProgramFiles)\WinMerge\WinMergeU.exe"  "$(Base)" "$(Mine)"

 ... and yes, the capitals was not correct - I changed and tested that and it also works now.

"$(ProgramFiles)\WinMerge\WinMergeU.exe" -e -x -u -wl -dl "$(BaseName)" -dr "$(MineName)" "$(Base)" "$(Mine)"

Here you will find more infos about WinMerge command line


CodeCompar works fine on my machine with the given template, Beyond Compare I have never tested.


If you have better templates let me know.

Regards, Bernd

Mar 1, 2011 at 3:42 PM

Thanks Bernd!

FYI I had to use:

"$(ProgramFiles (x86))\WinMerge\WinMergeU.exe"  "$(Base)" "$(Mine)"


Mar 6, 2011 at 9:57 PM

@Bernd - I must have done something silly on my #2 laptop. Both Beyond Compare & CodeCompare work perfectly on my dev laptop, as does Tortoise V2. All with VS 2010 SP1.

Nice one.



Mar 26, 2011 at 12:34 AM

I restarted Visual Studio 2010 after configuring the diff tool and the Diff took a couple times to get WinMerge to load, but now it all works OK. This is awesome, thanks Dev Team.

Jan 21, 2014 at 4:34 PM
I've created my own solution to this. Unfortunately it involves replacing KDIFF3.EXE in the TortoiseHG directory but since I don't use KDIFF3, it doesn't matter all that much to me.

The code needs to be compiled, there's a Visual Studio 2013 project here:



You need to clone/fork this, build the project, then copy these two files:


from the bin\Debug or bin\Release folder to your TortoiseHG folder, replacing KDiff3.exe that is already there (you should rename the old file first).

If you don't have Beyond Compare 3 installed in the default location, or want to use a different tool, you need to edit the KDiff3.exe.config file to specify the path to the executable and the format of its command line options.