Announcement

Collapse
No announcement yet.

Exit Code and report generation

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Exit Code and report generation

    Hi all.
    I want to write an application in C#, which compare two files, generates report and returns Exit Code.
    My C# code looks like below:

    Process bc3 = new Process();

    bc3.StartInfo.FileName = Path to BCompare.exe;
    bc3.StartInfo.Arguments = "/qc=binary" + "@script.txt" + file1 + file2 + report.html;
    bc3.StartInfo.UseShellExecute = true;
    bc3.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
    bc3.StartInfo.CreateNoWindow = false;

    bc3.Start();
    bc3.WaitForExit();
    Console.WriteLine(bc3.ExitCode);
    And there is a problem. When I use "/qc=binary" I get correct Exit Code, but report is not generated. When I use "/qc=binary " (with space between binary and "), I get report, but my Exit Code is always 0 (no matter, if files are the same or not). What I am doing wrong?

  • #2
    It isn't possible to run a script and use /qc= in a single command. You'll need to run it as two separate commands.

    Example:

    bcompare.exe /qc=binary file1.txt file2.txt
    bcompare.exe @script.txt file1.txt file2.txt report.html
    Last edited by Chris; 23-Jul-2014, 01:53 PM. Reason: Fix path for /qc example
    Chris K Scooter Software

    Comment


    • #3
      Thanks a lot. I only regret that I have lost half of a day to resolve this problem :/

      Comment

      Working...
      X