Beyond Compare command line script for folder comparison to generate results for both folder and files inside the folder

Raghav Pal picture Raghav Pal · Aug 3, 2016 · Viewed 7.1k times · Source

Here is what i am trying to do:

Use beyond compare command line script to compare 2 folders and i need result both at folder level and also individual file report(html)

I used following command.

load "D:\Reporting\Report1" "D:\Reporting\Report2"
expand all
select all
#compare binary
folder-report layout:side-by-side output-to:"D:\Reporting\Results\compare1.html" output-options:html-color

The above script is saved as bcscriptFolderComparison.txt Then i execute below command

"D:\Tools\BeyondCompare\Beyond Compare 4\BCompare.exe" @D:\Tools\BeyondCompare\Commands\bcscriptFolderComparison.txt

This give a folder comparison html report with side-by-side layout. This is okay. What i also need is html reports for individual files comparison as well. (So that if i click on any file in folder view it takes to the file comparison details. As it happens on Beyond Compare UI)

I tried changing the script to :

load "D:\Reporting\Report1" "D:\Reporting\Report2"
    expand all
    select all.files
    #compare binary
    file-report layout:side-by-side output-to:"D:\Reporting\Results\compare1.html" output-options:html-color

But then this does not create folder level view.

One of the options i have is to write a script that first passes the folder locations and do folder level comparison as above and then goes inside both folders and take up file name one by one and run this command :

text-report layout:side-by-side  options:line-numbers &
output-to:"%3" &
output-options:html-color "%1" "%2"

This will be saves bcscript.txt Then execute:

BCompare.exe @bcscript.txt  f:\file1.csv  f:\file2.csv f:\file1and2compare.html

Here file1 and file2 will be sequentially replaced by a custom script to give all available files inside the folders one-by-one.

Is there a direct/better way to do this by Beyond Compare command line.

Answer

Chris Kennedy picture Chris Kennedy · Aug 3, 2016

Use the folder-report option include-file-links to generate an HTML folder report with a link to a file report for each pair of files.

Script for Beyond Compare 4:

criteria rules-based
load "D:\Reporting\Report1" "D:\Reporting\Report2"
expand all
folder-report layout:side-by-side options:include-file-links output-to:"D:\Reporting\Results\compare1.html" output-options:html-color    

Note: include-file-links was added in Beyond Compare 4. If you're running an older version, you'll have to generate two separate reports using the folder-report and file-report commands.