I want to copy some folder structures that look like
+[a]
+[b]
| +[R]
| | +[xyz]
| | +[abc]
| | + a
| | + b
| +[D]
| +[xyz]
| +[abc]
| + a
| + b
+[c]
+[R]
| +[123]
| | + 2
| | + 3
| | + j
| +[567]
| | + 6
| | + z
| + a
| + b
+[D]
+[745]
| + 2
| + 3
| + x
+[234]
| + 6
| + y
+ a
+ b
names in brackets are folders.
I want to keep the file siblings of all [R] and [D] folders (they may appear on arbitrary deeply nested depths) but do not copy their sub folders (or at least not their files and further subfolders).
so in this example the R
and D
folders and the a
,b
,c
should be kept and the subdirs of R
and D
along with their files should be removed.
I tries it with options like /xf *\R\*\*
or /xd *\R\*
but robocopy
always complains about invalid arguments - it seems that it only can match parts of the filename and not the complete path - or at least it does not understand the path delimiter in the pattern.