Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2014
    Posts
    3

    Default 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. #2
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    4,609

    Default

    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 at 12:53 PM. Reason: Fix path for /qc example
    Chris K Scooter Software

  3. #3
    Join Date
    Jul 2014
    Posts
    3

    Default

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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •