Automatic comparision via command line

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kbugbee
    Visitor
    • Apr 2005
    • 4

    Automatic comparision via command line

    Is there any way to launch BC2 right into comparison? For example, I’d like to compare two folders with a custom rule set. Ideally, when I launch Beyond Compare via command line it will automatically start a rule based comparison of the two folders. Here are the command line I settings I was playing with:

    "c:\Program Files\Beyond Compare 2\BC2.exe" /qc=rules-based /rules="My Custom Rule" %tmp%\Folder1 %tmp%\Folder2

    When I do this, it starts BC2, but then I have to select all files, click Compare Contents, then Rules-based comparison, then Start. Is there any way I could automate the last part?

    Thank you,
    -Kris
  • chrroe
    Pooh-Bah
    • Oct 2007
    • 588

    #2
    Re: Automatic comparision via command line

    Hi Kris!

    I have 2 tipps for you. It depends whether the directories you want to compare are always the same or variable.

    1. The same: Open the folders in the folder-viewer like you want. Then klick on the icon with the balance to open the comparison control . Here you can click the radio button for Rules-based comparison .
    Now you can save this session in the session-menu for example under "test-session".

    In the commandline you can now start BC using "bc2.exe test-session". This should set the compare modus to rules-based.

    2. For variable folders you must start BC without any files or folders open in order to see an empty folder-viewer. Change the setting in comparison control like above.
    Now choose the "Set default..." in the session menu.
    Voila, now rules are used when you compare any folders,


    Hope this helps ...


    Bye
    Christoph

    Comment

    • kbugbee
      Visitor
      • Apr 2005
      • 4

      #3
      Re: Automatic comparision via command line

      Hello Christoph,

      Thank you for your response! I tried what you suggested but I see the same results using a saved session. Beyond Compare launches with the two folders open. I then need to select all files and do Compare contents. I'd like it if Beyond Compare would launch and immediately start comparing the two folders. Is that possible?

      Comment

      • Chris
        Team Scooter
        • Oct 2007
        • 5538

        #4
        Re: Automatic comparision via command line

        It isn't possible to launch the "Compare Contents" dialog on startup.

        If you save your session using your preferred critieria, set using Session|Comparison Control, BC will start a background comparison using that criteria as soon as it starts.

        If you want to automate generating a report of the comparison, it might be worth considering BC's scripting support. There are many good examples in our Script Central forum.
        Chris K Scooter Software

        Comment

        • kbugbee
          Visitor
          • Apr 2005
          • 4

          #5
          Re: Automatic comparision via command line

          Hey Chris,

          Is there an option I need to select to start a background comparison as soon as BC starts? Using the saved session, I can get BC to launch with the specified directories, but I still need to select all files, and do the compare.

          I looked into using Scripting (which looks very nice), but since it's not possible to launch the interactive file viewer from a script, I ruled it out.

          Here is my ideal situation:
          1. Automatically launch BC with folders
          2. Rule based compare of all files in both folders (there will never be orphans and I'm just comparing text files)
          3. BC presents the Compare Results dialog with list files that match and don't match
          4. At that point I would like to go interactive and select the mismatched files by double clicking on them and having them launch in the File Viewer

          Too much to ask?

          Comment

          • chrroe
            Pooh-Bah
            • Oct 2007
            • 588

            #6
            Re: Automatic comparision via command line

            Hi Kris!

            I think we can come close to your ideal situation but not 100%.

            </font><blockquote><font class="small">In Antwort auf:</font><hr />
            1. Automatically launch BC with folders

            [/quote]
            As I wrote before either via a saved session or the default session.

            </font><blockquote><font class="small">In Antwort auf:</font><hr />
            2. Rule based compare of all files in both folders (there will never be orphans and I'm just comparing text files)

            [/quote]
            From the BC helpfile:
            Enabling/Disabling Autoscan
            On the Session menu in the Folder Viewer, click Comparison Control .
            On the General tab, under Folder Handling, check or uncheck Automatically scan subfolders in background.


            </font><blockquote><font class="small">In Antwort auf:</font><hr />
            3. BC presents the Compare Results dialog with list files that match and don't match

            [/quote]
            As Chris pointed out it is not (yet?) possible to invoke the compare results automatically.

            </font><blockquote><font class="small">In Antwort auf:</font><hr />
            4. At that point I would like to go interactive and select the mismatched files by double clicking on them and having them launch in the File Viewer

            [/quote]
            In the comparison control you can select the checkbox to open all subfolders when opening a session.
            Using this you should see all files (in a folder treeview) and their status.
            From here you can doubleclick a file to open it in the file-viewer.


            Does this fit your needs? If not, keep on pointing out the problems.
            The only thing that differs from your idea is the display of the file list.


            Bye
            Christoph

            Comment

            • kbugbee
              Visitor
              • Apr 2005
              • 4

              #7
              Re: Automatic comparision via command line

              Thanks again Christoph. Yes, I'm really close to having what I need, just no automated way of doing the actual file compare which presents the Comparsion Results dialog. I think I'm just going to write a little app to sub-class the window and push the Compare Contents button for me.

              Comment

              Working...