4

I have two sub-folders in my main folder in source, from those two sub-folders I wanted to copy only one folder to destination.

And I have many main folders like that, wanted to apply same logic to all main folders. Please help me with the appropriate command for this.

Source:

  ABC
        123
        456
  XYZ
        123
        456

Destination:

ABC
      123     (to be copied)
XYZ
      123      (to be copied)

(‘456’ folder should exclude)

3
  • You appear to have six directory names there, several of which are duplicates. Is that in some structure, e.g. with the numeric folders as sub-folders within the lettered ones?
    – Pak
    Commented Jun 22, 2017 at 5:32
  • This probably shouldn't have been migrated. As for the question itself, just define all 456 folders as exclusions.
    – Seth
    Commented Jul 6, 2017 at 6:23
  • This question is unclear. Are you looking to not copy any folder with a certain name, or only if it's the first child? Or do you only want folder 123 when it's the child folder
    – Dave
    Commented Jul 6, 2017 at 6:37

1 Answer 1

7

Use robocopy's xd parameter to exclude folders; e.g. robocopy source_folder destination_folder /xd 456

You must log in to answer this question.