Do not ignore Hidden/system/protected files in scripted folder compare

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mandy4gis
    Journeyman
    • May 2015
    • 11

    Do not ignore Hidden/system/protected files in scripted folder compare

    In my recursive folder compare script I want to compare everything but beyond compare ignores hidden/system/protected files. How to not ignore Hidden/system/protected files in scripted folder compare? What am I missing?

    My script so far

    log verbose "%4"
    load "%1" "%2"
    expand all
    compare binary
    criteria binary
    option confirm:no-to-all
    folder-report layout:side-by-side options:display-mismatches,column-size,column-version,column-timestamp output-to:"%3"
  • Aaron
    Team Scooter
    • Oct 2007
    • 16017

    #2
    Hello,

    After log, but before load, add:
    filter include-protected


    You can also reorder a few other lines to speed up the script:

    log verbose "%4"
    option confirm:no-to-all
    filter include-protected
    criteria binary
    load "%1" "%2"
    expand all
    folder-report layout:side-by-side options:display-mismatches,column-size,column-version,column-timestamp output-to:"%3"


    This way, you have the filter and criteria set, which then apply to the load command during the load. How does this work for you?
    Aaron P Scooter Software

    Comment

    • mandy4gis
      Journeyman
      • May 2015
      • 11

      #3
      Thanks for your quick reply! Whats the difference between "compare binary" and "criteria binary"?

      Comment

      • Chris
        Team Scooter
        • Oct 2007
        • 5538

        #4
        "criteria binary" sets the background content comparison type. It compares all files. It is the equivalent of setting binary comparison in the "Session > Session Settings" dialog when running interactively.

        "compare binary" operates on selected files. It is the equivalent of the "Actions > Compare Contents" command when running interactively.
        Chris K Scooter Software

        Comment

        • mandy4gis
          Journeyman
          • May 2015
          • 11

          #5
          How do I add add folder and file filters in addition to "filter include-protected"? Also is there a way to generate both side by side and xml report at the same time?

          Comment

          • Aaron
            Team Scooter
            • Oct 2007
            • 16017

            #6
            Hello,

            The filter line would use the same string generated in the graphical interface, represented in the upper-right toolbar, surrounded by quotes. For example:
            filter "*.txt;-ExcludeThisFolder\"

            To also include protected, add this option after the quotes:
            filter "*.txt;-ExcludeThisFolder\" include-protected
            Aaron P Scooter Software

            Comment

            • mandy4gis
              Journeyman
              • May 2015
              • 11

              #7
              Thanks. Is there a way to generate both side by side and XML report at the same time?

              Comment

              • Aaron
                Team Scooter
                • Oct 2007
                • 16017

                #8
                Oh, sorry, missed that part. Yes and No.

                Script is a series of sequential actions. Both reports do not generate simultaneously, but you can have one report command right after the other in scripting.

                log verbose "%4"
                option confirm:no-to-all
                filter include-protected
                criteria binary
                load "%1" "%2"
                expand all
                folder-report layout:side-by-side options:display-mismatches,column-size,column-version,column-timestamp output-to:"%3"
                folder-report layout:xml output-to:"%5"
                Aaron P Scooter Software

                Comment

                • mandy4gis
                  Journeyman
                  • May 2015
                  • 11

                  #9
                  Thanks! Also shouldn't it be "filter "-*.txt;-ExcludeThisFolder\" include-protected" instead of "filter "*.txt;-ExcludeThisFolder\" include-protected"?

                  Will having the second folder-report action double the run time?

                  Comment

                  • Aaron
                    Team Scooter
                    • Oct 2007
                    • 16017

                    #10
                    That depends on if you want to include or exclude *.txt files. Also, you'll want to manage quotes around the filter string, but not actually around the "filter command". The string itself is identical to the string constructed in the graphical interface, so I usually recommend setting and testing in a graphical Folder Compare, then copy/paste the string into the script.

                    It will not double the run time, as loading the initial comparison and running that scan is generally the most intensive step. It will use the already loaded information to generate the report.
                    Aaron P Scooter Software

                    Comment

                    Working...