No announcement yet.

attrib causing me grief

  • Filter
  • Time
  • Show
Clear All
new posts

  • attrib causing me grief

    Actually, it's system files that are giving me grief and I was trying to use attrib to get around them. I noticed that the synch command was not deleting right-hand folders if they contained a system file (like thumbs.db - though the same problem occurs with right-hand read-only files). So I thought I'd change the attributes of the orphan files and then delete them before running the synch command.

    Here's my script:

    load "G:\My Pictures\2006" "N:\My Pictures\2006"
    expand all
    criteria timestamp:1sec;IgnoreDST
    folder-report title:"2006 Images" layout:side-by-side output-to:"C:\Documents and Settings\Tim Buchanan\My Documents\Backup Logs\20070812-133307-2006 Images-Report.html" options:display-mismatches output-options:html-color
    log verbose "C:\Documents and Settings\Tim Buchanan\My Documents\Backup Logs\20070812-133307-2006 Images-BCLog.txt"
    select rt.orphan
    attrib -s
    delete rt
    sync create-empty mirror:lt->rt

    This script dumps the following in the log:

    8/12/2007 1:33:10 PM >> log verbose "C:\Documents and Settings\Tim Buchanan\My Documents\Backup Logs\20070812-133307-2006 Images-BCLog.txt"
    8/12/2007 1:33:10 PM User name: Tim Buchanan
    8/12/2007 1:33:10 PM >> select rt.orphan
    8/12/2007 1:33:10 PM >> attrib -s
    8/12/2007 1:33:10 PM Script Error: Incorrect parameters
    8/12/2007 1:33:10 PM >> User Canceled
    8/12/2007 1:33:10 PM Script completed in 2.03 seconds

    Any ideas?


  • #2
    Re: attrib causing me grief

    Hi trb!

    I was able to reproduce your problem. attrib -s or +s causes a scripting error, although the script reference in the BC online help mentions it as a valid parameter.

    All other attributes seem to work fine. Besides in the BC user interface using the Attrib... command from the context menu in the folder-viewer does not offer the "system" attribut. I Don't know if it is a restriction of the operating system or a glitch in BC or the documentation.

    But to solve your initial problem you could try the following:
    Leave out he attrib command and use the "option confirmprompt|yes-to-all|no-to-all)" command to avoid dialog boxes when using the delete command.



    • #3
      Re: attrib causing me grief


      I tested on my own system, and it looks like there is a bug in the current version that prevents the system attribute from being cleared or set in a script. I'll add it to our bug list to be fixed.

      I agree that adding "option confirm:yes-to-all" might solve the problem in the script.

      Thanks for the helpful posts!
      Chris K Scooter Software


      • #4
        Re: attrib causing me grief

        In fact, adding "option confirm:yes-to-all" does fix the issue and I am now synchronizing without error.

        Thanks Christoph and Chris K for the help debugging this one!


        • #5
          Re: attrib causing me grief

          The "attrib" command doesn't support changing the system attribute, either through scripts or interactively. The docs are incorrect. Sorry for the trouble.
          ZoŽ P Scooter Software