Recursive Binary Compare of 2 folders

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • abiloukha
    New User
    • Mar 2015
    • 1

    Recursive Binary Compare of 2 folders

    Hi folks, I would appreciate a little help -- breaking my head over this seemingly basic task.
    I am looking to do a command line "sanity check" binary recursive comparison of two folders (the folders should be the same), and then examine the exit code to interpret the result. Not interested in creating or viewing difference reports, etc. just a binary recursive compare, then look at the exit code 0 if they are binarily identical, exit code 1 if the folders are binarily different.

    Running command line:
    Code:
    bcomp.com "c:\DEV\DEPLOYMENT\DEV\script.txt" "C:\DEV\DEPLOYMENT\DEV\21.1.0.78" "C:\DEV\DEPLOYMENT\DEV\21.1.0.781"
    The script I have:
    Code:
    criteria binary
    load %1 %2

    The Beyond Compare UI running binary compare shows no differences (there are a couple of files with different time stamps, but the content of the files is identical), but the command line opens a BeyondCompare window, shows successful execution of a script, and that's it. When I close that window and read the %errorlevel% it's always 0, regardless of whether the folders compared were identical or different (I add an extra file for testing purposes).

    Could you please help with the correct syntax for the script, or explain what I am doing wrong.

    Many thanks.
  • Chris
    Team Scooter
    • Oct 2007
    • 5538

    #2
    This is a copy of the response I sent to your email on the same topic today:

    Beyond Compare doesn't support command line comparison of two folders that returns the result as an exit code.

    The /qc command line switch allows command line comparison of two files that returns the result an exit code. There is not equivalent command for folders in the current version of Beyond Compare, although this is on our wish list for a future version.

    The only command line folder comparison supported in the current version is to output comparison results as a report file that lists differences. This uses Beyond Compare's command line scripting support.

    Example script:
    load c:\folder1 c:\folder2
    expand all
    folder-report layout:side-by-side options:display-mismatches output-to:c:\report.txt

    To run the script silently, use the following command:
    bcompare.exe /silent @c:\script.txt

    When running a script, a non-zero exit code is only returned if there is a syntax error in the script.
    Chris K Scooter Software

    Comment

    Working...