My directory structure looks like this;
folder1
folder2 (thousands of folders like this)
folder3
someImage.jpeg
someDoc.doc
folder4 (optional folder)
someImage.jpeg
someDoc.doc
I want the script to copy the folder 2s which contain folder 4s maintaining the folder structure but only copying the files in folder 4. Like this;
folder1
folder2 (thousands of folders like this)
folder3
folder4 (optional folder)
someImage.jpeg
someDoc.doc
I’ve got a simple for loop which can identify the folders which contain folder 4 and then Robocopy the files to some directory. I can’t figure out how to copy the entire folder structure whilst skipping the files at folder 3.
There is an option in the
xcopycommand that creates the directory tree.Do it first and then merely copy the files inside folder 4s.