0

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 Jun 22 '17 at 5:32
  • This probably shouldn't have been migrated. As for the question itself, just define all 456 folders as exclusions. – Seth Jul 6 '17 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 Jul 6 '17 at 6:37
1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy