Comparing folders with Command Line scripts

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BrianReis
    Visitor
    • Feb 2018
    • 6

    Comparing folders with Command Line scripts

    I have been trying to write a script to compare 2 folders with some files and tell me if they are equal or false

    My folder structure is:

    Folder 1: Folders Folder 2: Folders
    Empty Folder Empty Folder
    FolderA FolderA
    File.txt File.txt
    FolderB FolderB
    SubFolder SubFolder
    File.txt File.txt


    My script is:
    ************************************************** ************************
    *load "%1" "%2" *
    *expand all *
    *select all *
    *compare binary *
    *folder-report layout:side-by-side options:"%4" output-to:"%3" *
    ************************************************** ************************

    And in CLI i write:
    ************************************************** ************************************************** *****************
    *Bcomp.exe "@C:\FolderScript.txt" "C:\Folder1" "C:\Folder2" "C:\FolderReport.txt" display-all /silent *
    ************************************************** ************************************************** *****************

    Situation 1- My files from folder 1 are equal to files from folder 2:
    When comparing these 2 folders with GUI i am able to get that they are equal (with = sign)
    When comparing these 2 folders with Script i am able to get that they are equal (with = sign)

    Situation 2- My files from folder 1 are different to files from folder 2:
    When comparing these 2 folders with GUI i am able to get that they are different (with <> sign)
    When comparing these 2 folders with Script i am not able to get that they are different (i get << betweent files)


    I am using the latest stable version 3.3.13 of Beyond Compare

    Conclusion, what am i missing in order to get the <> sign when comparing these 2 folders when those files are different?

    PS: i do want to get the report in a text file and not in a html file (where i get the correct results)
  • BrianReis
    Visitor
    • Feb 2018
    • 6

    #2
    The format got this part confusing

    Folder 1: Folders Folder 2: Folders
    Empty Folder Empty Folder
    FolderA FolderA
    File.txt File.txt
    FolderB FolderB
    SubFolder SubFolder
    File.txt File.txt

    Comment

    • Aaron
      Team Scooter
      • Oct 2007
      • 16000

      #3
      Hello,

      In script, you are still comparing timestamp and size, and then selecting and scanning binary. This way, the file would still be Newer or Older along with the comparison difference. Instead, if you remove the select and compare commands, and set a criteria, then only binary criteria is used:

      criteria binary
      load "%1" "%2"
      expand all
      folder-report layout:side-by-side options:"%4" output-to:"%3"

      How does this work for you?
      Aaron P Scooter Software

      Comment

      • BrianReis
        Visitor
        • Feb 2018
        • 6

        #4
        Originally posted by Aaron
        How does this work for you?
        Hello, it did work great. Wasn't aware of that detail since i didnt need it for the Text or the binary comparison.

        Comment

        Working...