Announcement

Collapse
No announcement yet.

Folder compare automation

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Folder compare automation

    I wast trying to automate folder comparision through java.
    The code was working fine for a test folder.
    But when I tried to compare the actual folder , the code failed coz there is a space in the folder name.
    I am using this to start a beyond compare process.

    Process p = new ProcessBuilder("C:\\Program Files\\Beyond Compare 3\\BCompare.exe","@C:\\compar sion\\comparison.txt","\"C:\\compar sion\\20120629_1817\"" , "\'C:\\compar sion\\20120824_1045\'","\'C:\\compar sion\\myreport.html\'").start();

    I have tried both single quotes (\' ) and double quotes (\" ) , but nothing is working. I get too many arguments error.
    The same line above was working earlier the folder name was comparsion , later i renamed folder to "compar sion" . Also I did not have any extra quotes before.

  • #2
    This depends on your automation solution. I would suggest first testing from the command line. The final command line, as passed to Windows, should include the quotes:
    Code:
    "C:\Program Files\Beyond Compare 3\BCompare.exe" "@c:\comparison\comparison.txt" "c:\compar sion\20120629_1817" "C:\compar sion\20120824_1045" "c:\Compar sion\myreport.html"
    Does this command line launch and run as you expect when manually executed from the Windows Command line?
    Aaron P Scooter Software

    Comment


    • #3
      No this does not run. I get a an error.: too many arguments. Here is the snapshot of the log file.

      9/25/2012 10:13:20 AM >> load c:\compar sion\20120629_1817 C:\compar sion\20120824_1045
      9/25/2012 10:13:20 AM Fatal Scripting Error: Too many arguments

      Also here is my script file.

      log normal "C:\comparsion\log.txt"
      load %1 %2
      expand all
      folder-report layout:side-by-side &
      options:column-none,column-size &
      output-to:%3 &
      output-options:wrap-word,html-color
      Last edited by rpant; 25-Sep-2012, 09:35 AM.

      Comment


      • #4
        Also thanks for the great software and even better support. I honestly never expected a reply in 13 mins.

        Comment


        • #5
          Figured out myself.
          needed to put quotes around arguments in the script file. eg. load "%1" "%2"

          Comment


          • #6
            Hello,

            In your script, please also add quotes around the parameters:
            load "%1" "%2"
            and
            output-to:"%3" &


            The issue is that when the parameters are placed into the script, they still have whitespace in their names, and these breaks would cause issues if not surrounded by quotes.

            Update: And I see you figured it out; my screen refreshed right after posting.
            Last edited by Aaron; 25-Sep-2012, 11:04 AM. Reason: Update
            Aaron P Scooter Software

            Comment

            Working...
            X