How to use Robocopy to eXclude Directories?

Anonymous
2011-04-01T04:56:09+00:00

/XD dirs [dirs]... :: eXclude Directories matching given names/paths.

RoboCopy D:\ Z:\ /MIR /R:1 /W:1 /XD D:\System Volume Information, does anyone have any suggestions on how to exclude one directory for Robocopy function?

I don't understand that I cannot see any directory under D: drive called "System Volume Information", when robocopy executes its command, this directory shows on the screen, if there is only one hidden system directory, it will be fine, but what about there are 3000 thousands this kind of directories, then it will not be wise to exclude them one by one. Referring to robocopy.txt, there is no option to exclude any hidden system directory.

Do you have any suggestions on any better approachs to handle this case?

Windows for home | Other | Apps

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question. To protect privacy, user profiles for migrated questions are anonymized.

0 comments No comments
{count} votes
Accepted answer
  1. Anonymous
    2011-04-02T13:22:55+00:00

    Hi,

    You can refer to these links for more information on the different commands and how to use RoboCopy:

    How to Use Robocopy to copy security information without copying any file data

    http://support.microsoft.com/kb/323275

    Return codes that are used by the Robocopy utility in Windows Server 2008

    http://support.microsoft.com/kb/954404

    You can also refer to:

    http://en.wikipedia.org/wiki/Robocopy

    Hope this helps

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Anonymous
    2013-07-18T16:05:04+00:00

    Dear John, don't provide answer if you don't have a real answer!

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2016-03-23T08:39:30+00:00

    I have requested that this feature be added to robocopy. If you want to upvote the feature request (and you're a Windows 10 user), open Windows Feedback, search for "robocopy exclude system directories", and upvote the corresponding feature request.

    It is possible to skip system and hidden *files*, using /XA:SH, but I can find no way to skip system and hidden *directories*. The only workaround, as you mentioned, is to skip directories by name, e.g., /XD "D:\System Volume Information" /XD "D:\Recovery".

    In practice, there typically aren't a lot of system and hidden directories, but this is an issue that should be addressed in order to make robocopy truly robust.

    3 people found this answer helpful.
    0 comments No comments