34

Since I don't really like Total Commander's internal diff Compare Contents used in Compare by content and Synchronize DirsCompare left & right, I want to use something else like WinMerge or KDiff3.

Is this possible to launch an external program with the paths to the marked files in the left & right pane? That would solve Compare by content. Any other way to solve it? Can I control Synchronize Dirs so it does the same when I compare file content there?

Any other suggestions to easily make diffs in Total Commander with external diff program?

Peter Mortensen
  • 12,090
  • 23
  • 70
  • 90
Joel
  • 443
  • 1
  • 4
  • 6

2 Answers2

38

There are many ways to do this (here I'm using BeyondCompare as an example, it's the best I've found in this category, but the solution also works well with WinMerge):

A) Edit wincmd.ini under %USERPROFILE%\AppData\Roaming\GHISLER\ by default, and add something like this:

[Configuration]
CompareTool=C:\Program Files\Shareware\FileCmp\BeyondCmp\BCompare.exe

Now all comparisons are made using this app instead of the internal tool.


B) Using TotalCmd's StartMenu (command "Change start menu..."), add these commands:

Title:

BC (Compare left-vs-right directories)

Command: %YourPath%\BeyondCmp\BCompare.exe

Parameters: %X%p %X%t


Title:

BC (Compare current file under cursor vs same file in the other panel)

Command: %YourPath%\BeyondCmp\BCompare.exe

Parameters: "%X%p%x%n" "%X%t%x%n"


Title:

BC (Compare current file in left vs current file in right)

Command: %YourPath%\BeyondCmp\BCompare.exe

Parameters: "%X%p%n" "%X%t%m"

Halil
  • 103
  • 4
TheNewbie
  • 601
  • 6
  • 10
  • What is the effect of %X and %x? – Joel Feb 16 '11 at 08:25
  • 1
    %X Interprets the following parameters after this parameter as left/right instead of source/target: %P, %p (left path), %T, %t (right path), %N, %n (left name), %M, %m (right name), %S, %s (left selected), %R, %r (right selected) – TheNewbie Feb 16 '11 at 09:56
  • %x Interprets the following parameters after this parameter again as source/target Example: %X%P %x%P sends left and source path to the called program – TheNewbie Feb 16 '11 at 09:57
  • To the option A, it worked for me (v8.51a) only if I added the `CompareTool` somewhere near the beginning of the wincmd.ini file. I don't know the exact setting which must be preceded by this, so I'd say the simplest is to put it to the beginning of the file. – TLama Jun 30 '15 at 08:30
  • 2
    As of TC 9 you can use %C1 %C2 for better emulating the way the internal compare tool works: %C1 Like the first parameter of "Compare by content" - %C2 Like the second parameter of "Compare by content" – marlar Feb 19 '17 at 20:30
  • Thank you very much. Does anyone know what would be the Parameters if I select two different files in the same panel (p.e. 2 files in the right panel)? – Reman Mar 25 '18 at 21:34
  • 1
    Hint: Under Configuration menu, there is a submenu called "Change ini file directly" – Gabriel Jan 18 '21 at 13:04
2

I came accross this question because I wanted to use Visual Studio Code as external diff tool.

Since VS Code isn't primarly a diff tool one can't just invoke the exe-file with two filenames as parameters. Instead the option --diff or just -d has to be specified.

This is important when editing the WINCMD.INI. The line Comparetool has to take the path to code.exe and the diff-option:

[Configuration]
Comparetool="C:\Program Files\Microsoft VS Code\Code.exe" --diff
...
khlr
  • 121
  • 3