No announcement yet.

Simple Same or Not result for command line compare?

  • Filter
  • Time
  • Show
Clear All
new posts

  • Simple Same or Not result for command line compare?

    I'm fairly new to BC3.
    I'm looking for a way to get a binary answer from a command line - either these 2 folders match, or they don't.
    I've searched through the info on scripting and command line options and I'm not seeing a way to do this with BC3, but maybe I'm just missing it??

    The full scope of what I'm looking to do is:
    1. I have list of folders (the list will change often)
    2. for each folder in the list, compare these folders on server A vs server B
    3. for each folder, get a simple "MATCH" or "DOESN"T MATCH" result and output to a file
    4. I'll end up with some sort of output (a file) with a MATCH or DOESN"T MATCH for each folder I wanted to to compare.

    I do not want to sync, I just need to get confirmation of whether they are or are not synched.

    Thanks for anyone who can help out with this!

  • #2

    We have two main strategies for working on the command line level: /quickcompare and scripting. /quickcompare only works with a pair of files, so we will need to use BC Scripting for this.

    BC Scripting can be called from the command line with:
    bcompare.exe "@c:\bcscript.txt" "c:\folder1" "c:\folder2"

    where bcscript.txt can contain a few simple lines (where %1 and %2 will refer to the first 2 parameters after the script file, in this case: folder locations), such as:
    load %1 %2
    expand all
    folder-report layout:summary output-to:"c:\bcreport.txt"

    This will generate a bcreport.txt file (of the Summary type), which you can parse for information. Alternatively, you could generate the XML report if that would be easier to parse. We do not support another method of output at this time. The reports are the same as if generated using the graphical interface.

    Please let us know if you have any questions.
    Aaron P Scooter Software


    • #3
      Would it be useful for susieqz's batch file to check the exit status of the bcompare?



      • #4

        He could check it for the Script error levels, but not for if two folders are equal.
        Aaron P Scooter Software