Announcement

Collapse
No announcement yet.

recursive non-interactive

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

  • recursive non-interactive

    I have two directories, and I'd like to compare them non-interactively (calling Beyond Compare from a script). I'd like to know if there are any added/missing files in either directory, and for files that match, I'd like to do a smart compare. Then I'd like the final return value to be whatever the most-severe return from any comparison was (eg: if all files are binary same, return 1; if some files are binary same, some are rules-based same, return 2; etc).

    I haven't found a way to do this with a single command - I am finding all of the files, and looping through calling Beyond Compare multiple times. I can compare one pair of files like this.
    BComp.com /ignoreunimportant /silent DIR1\FILE DIR2\FILE
    I'd rather something like this.
    BComp.com /ignoreunimportant /silent /recursive DIR1 DIR2

    Is there a better way?

  • #2
    Beyond Compare can't compare a pair of folders and return comparison status as a return value. It's only supported for pairs of files. When comparing folders from the command line, comparison status can only be output as a report (folder-report scripting command).

    To compare a pair of files and output comparison results as return value, use the /qc command line switch.

    Example:
    bcompare.exe /qc file1.txt file2.txt

    If you wrap it in a batch file, 'echo %errorlevel%' immediately after running bcompare.exe will print the return value to the screen.

    The /qc command line switch and exit codes are documented in the Command Line Reference topic in Beyond Compare's help file.
    https://www.scootersoftware.com/v4he...reference.html
    Chris K Scooter Software

    Comment

    Working...
    X