No announcement yet.

Robocopy - How to remove Offline File Attribute?

  • Filter
  • Time
  • Show
Clear All
new posts

  • Robocopy - How to remove Offline File Attribute?

    Hi all,

    I'm Robocopying a bunch of files from an archive store (using /copyall) which (because they are archived) have the O attribute set. Robocopy copies the files to the new server ok, I can open them etc, however it retains the O attribute, and hence displays all files with the OFFLINE file marker even though they aren't.

    I found that Robocopy has a nice switch that allows you to add or remove attributes during copy, this is of the form /A+:[RASHCNET] or /A-:[RASHCNET]. where RASHCNET are the available attributes. Unfortunately the available attributes do not include the O attribute (the one i happen to need), and trying to use it anyway reports ERROR : Invalid Parameter #5 : "/A-:O"

    Does anyone know if there is a way to remove the O attribute from files during Robocopy?

  • #2
    It seems that Robocopy can take action with files identified by the O attribute, but that it cannot remove the attribute itself.

    See 'Changing file attributes after copying' and search for Offline on that page as well.

    A recent poll suggests that 6 out of 7 dwarfs are not happy


    • #3
      Yes that doc just confirms my findings. Ie that the O attribute is the only attribute that Robocopy won't change during the copy.

      I can remove the attribute afterwards as a secondary step, but it would be neater to do it as part of the copy. This is a 1.2 million file volume transfer, and it is annoying to have to do this as a 2 step process.

      Robocopy is a great tool, and it isn't often I hit an issue with it. There must be a reason they didn't include the O attribute as part of the change attribute switch, but i can't think what. I'd love to find a workaround to do this in one pass, but its got me stumped so far.
      Last edited by markey164; 19th November 2015, 20:14.


      • #4
        You could create a batch file that includes a command to remove the attribute after Robocopy has finished. Although it is still a two-stage process at least you can remove the attribute.


        or good old Attrib:
        A recent poll suggests that 6 out of 7 dwarfs are not happy


        • #5
          Unless i am mistaken, the offline attribute 'O' is an extended attribute, and you cannot remove extended attributes using the attrib command.

          Which just leaves Powershell, or some 3rd party tool. Resetting all file attributes in a folder seems to be quite easy, but removing a particular attribute which may not be present on all files, ie so as to retain other attributes your files may have. That seems to be non trivial unfortunately.
          Last edited by markey164; 20th November 2015, 19:07.


          • #6
            Looks like you are right. Google search reveals other (Powershell) examples
            A recent poll suggests that 6 out of 7 dwarfs are not happy