How to start kdiff from Console application?

c#

Solution

You need to use `Process.Start()`:

string kdiffPath = @"c:\Program Files\Kdiff3.exe"; // here is full path to kdiff utility
string fileName = @"d:\file1.txt";
string fileName2 = @"d:\file2.txt";

Process.Start(kdiffPath,String.Format("\"{0}\" \"{1}\"",fileName,fileName2));

Arguments as described in the docs: `kdiff3 file1 file2`

Problem

UPDATED... I want to call kdiff from Console application. So I'm building two files and want to compare they at the end of executing my program: ``` string diffCmd = string.Format("{0} {1}", Logging.FileNames[0], Logging.FileNames[1]); // diffCmd = D:\vdenisenko\DbHelper\DbHelper\bin\Debug\Reports\16_Nov 06_30_46_DiscussionThreads_ORIGIN.txt D:\vdenisenko\DbHelper\DbHelper\bin\Debug\Reports\16_Nov 06_30_46_DiscussionThreads_ORIGIN.txt System.Diagnostics.Process.Start(@"C:\Program Files (x86)\KDiff3\kdiff3.exe", diffCmd); //specification is here http://kdiff3.sourceforge.net/doc/documentation.html ``` It runs kdiff3 tool, but something wrong with filenames or command... Could you please look on screenshot and say what is wrong?

Original source