View Full Version : How to execute script?
patel1984
08-Nov-2011, 03:50 AM
Hello Support,
I am very much not familiar with BC3.
I am not able to find "How to execute a script" in BC3.
How to execute a script while comparing two Text Files?
I am in need of a VB script to get a mismatch report form one/both sides.
Thanks
Denil Patel
Aaron
08-Nov-2011, 08:54 AM
Hello,
If you need a report (like the text report you generate from the graphical interface, Text Compare session, Session menu -> Text Compare Report), you would use BC Scripting.
bcompare.exe "@c:\bcscript.txt"
where bcscript.txt contains a basic script to generate:
text-report layout:side-by-side output-to:"c:\bcreport.txt" "c:\file1" "c:\file2"
documented in the Help file in the Using Beyond Compare section -> Automating with Script.
If you need to just know if two files are equal or different, you can use the command line parameter: bcompare.exe /qc "file1.txt" "file2.txt"
which will return a numeric %errorlevel% documented in the Help file -> Command Line Reference, at the bottom.
Let us know which route you were looking to take.
patel1984
08-Nov-2011, 10:51 PM
Hello Aaron,
I have tried both steps mentioned above.
I have reviewed Help File as well.
1) I have tried scheduling a a script in notepad file, but unable to see any output.
2) Could not understand where to put command line parameters.
Please explain me in detail as i am totally new to Beyond Compare.
Thanks
Denil Patel.
Aaron
09-Nov-2011, 08:50 AM
Hello,
No problem. These are two very different scenarios, however. Do you know which output you want?
A file that is a report of the current comparison (or the the different text itself)?
or
A command line error code that can be used as part of a larger automated process?
I'll assume a file, since the command line error code is far more specific; you would know if you needed that.
First, setup this line of text in a notepad file:
text-report layout:side-by-side output-to:"c:\bcreport.txt" "c:\file1" "c:\file2"
Replace c:\file1 and c:\file2 with the two files you want to compare, and replace c:\bcreport.txt with where you want to generate the report. Otherwise, it will make a bcreport.txt file in your base c:\
To execute this command (and you should see a script window pop-up showing it is running), type this in the command line.
First, navigate to the C:\program files\beyond compare 3\ directory using the cd command.
Then type in
bcompare "@c:\bcscript.txt"
Where you replace c:\bcscript.txt with the full path location of where your script file is on your harddrive.
If you are still having any problems, please let us know. A video capture may help, using a program like Jing:
http://www.techsmith.com/jing.html
*Jing is not a Scooter Software product and is not supported by Scooter Software.
You can also attach your script file, or email us your attachments at support@scootersoftware.com
If you email us, please include a link back to this forum post for our reference.
vBulletin® v3.7.1, Copyright ©2000-2012, Jelsoft Enterprises Ltd.