Results 1 to 10 of 10
  1. #1
    Join Date
    May 2015
    Posts
    9

    Default 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"

  2. #2
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,619

    Default

    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

  3. #3
    Join Date
    May 2015
    Posts
    9

    Default

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

  4. #4
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    4,609

    Default

    "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

  5. #5
    Join Date
    May 2015
    Posts
    9

    Default

    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?

  6. #6
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,619

    Default

    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

  7. #7
    Join Date
    May 2015
    Posts
    9

    Default

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

  8. #8
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,619

    Default

    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

  9. #9
    Join Date
    May 2015
    Posts
    9

    Default

    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?

  10. #10
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,619

    Default

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •