Moving to BC4 from BC2 Question on comparison

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bkea
    Visitor
    • Aug 2018
    • 3

    Moving to BC4 from BC2 Question on comparison

    We currently have a VB6 application utilizing BC2 to compare files in folders across 2 disks (master and clients)

    The application no longer works with the move to Windows 10. Not sure if the VB6 version no longer works because BC2 does not work with Windows 10. I've rewritten the host application to be a .NET WinForm application using FW 4.6. I have also down loaded the 30 day trial copy of BC4.

    The goal is to utilize a script file (also generated dynamically in same .NET app) to perform the comparisons of two files and generate an output report (.txt) silently. I.E. I do not want to start a view or see a BC window. This is how it worked under the VB6 version.

    How do I accomplish this?
    I have:
    1. written a simple script to compare two files and output to a txt file
    2. in a command line session ran the following command to use BC4: bCompare. exe "MytestScript.txt"

    And I still get a sesion window/view. In the .NET applciation I will simply open a Shell / Process session and execute the BCompare.exe command.

    My script file contains:
    file-report layout:side-by-side options:display-mismatchs output-to:"C:\Temp\myreport" "I:\New Text Document" "I:\New Text Document (3).txt"

    Can I use BC2? Will it work on Win10
    We also have a lic for BC3.
  • Aaron
    Team Scooter
    • Oct 2007
    • 15997

    #2
    Hello,

    BC2 is not supported on Windows 10, but does run. You could also use BC3 or BC4. BC4 is the current version with the most fixes and features. I would suggest testing from the Windows command line first running a set sample script manually to test platform compatibility before implementing into your .NET solution.

    For an automated solution, I would recommend using a Portable Install (C:\Tools\Beyond Compare 4\ as a single directory install) so that any user (graphical or automated) shares the same settings.

    The script itself looks good, as the syntax is mostly the same (although you can now execute different reports for different filetypes, so text files use the text-report, picture files use picture-report, and file-report auto-picks which depending on the files).
    To launch a script, like BC2, you need "@"
    bcompare.exe "@c:\bcscripts\bcscript.txt"

    We still host all major versions on our Download page, so you can download and try BC2, BC3, or BC4 for testing/registering, on the left side menu:
    http://www.scootersoftware.com/download.php
    Aaron P Scooter Software

    Comment

    • bkea
      Visitor
      • Aug 2018
      • 3

      #3
      I am still not able to get a successful compare of two files. I've tried several combinations of the script file and one variation of the commnad line. First the commnad line:
      bcompare.exe "@c:\temp\MyScript.txt"
      Throws an exception:
      A Fatal error has occured:
      Unexpected argument(s) "title:EngDiskBCReport
      The script will now exit.

      If I exclude the @ sign I do not get the same error. But the view does appear and I get a different error:
      8/13/2018 8:15:52 AM *** Beyond Compare 4 Evaluation -- 28 days remaining ***
      8/13/2018 8:15:52 AM >> file-report title:"EngDiskBCReport" layout:side-by-side output-to:"c:\temp\myBCReport.txt" options:display-all "C:\temp\Test1.txt" "C:\temp\Test2.txt"
      8/13/2018 8:15:52 AM Fatal Scripting Error: Unexpected argument(s) "title:EngDiskBCReport"


      And here is my script file. Again I've tried several combinations and I believe this is the most stripped down version:
      file-report title:"EngDiskBCReport" layout:side-by-side output-to:"c:\temp\myBCReport.txt" options:display-all "C:\temp\Test1.txt" "C:\temp\Test2.txt"
      8/13/2018 8:18:16 AM Script completed in 2 minutes, 24 seconds


      So what am I doing wrong?

      Bill

      Comment

      • Chris
        Team Scooter
        • Oct 2007
        • 5538

        #4
        The argument order for file-report needs to be changed to match the scripting reference for Beyond Compare 4.

        Try this:

        file-report layout:side-by-side options:display-all title:"EngDiskBCReport" output-to:"c:\work\myBCReport.txt" "C:\work\Test1.txt" "C:\work\Test2.txt"
        Chris K Scooter Software

        Comment

        • bkea
          Visitor
          • Aug 2018
          • 3

          #5
          Moving to BC4 from BC2 Question on comparison

          Originally posted by Chris
          The argument order for file-report needs to be changed to match the scripting reference for Beyond Compare 4.

          Try this:

          file-report layout:side-by-side options:display-all title:"EngDiskBCReport" output-to:"c:\work\myBCReport.txt" "C:\work\Test1.txt" "C:\work\Test2.txt"
          Chris that worked, thank you!!!

          But I still got a view. In code I am going to shell out or open a process thread to execute a command line. Trying to avoid the user ever seeing a BC view. Could this be because I am on a trial license?

          -

          Comment

          • Zoë
            Team Scooter
            • Oct 2007
            • 2666

            #6
            You can use the /silent command line switch to tell BC to suppress the scripting dialog along with any other user interaction. If you do that in trial mode I believe it just logs the number of days remaining in the trial rather than showing the nag dialog too.
            Zoë P Scooter Software

            Comment

            Working...