I have a large set of files (45,000+) in a pretty complex folder structure. I extracted a subset of ~13,000 files and their paths (relative to the root folder) that I want to copy with the original folder path.
Although I've searched thoroughly, I couldn't find a way, with xcopy or robocopy, to do what I want. I could easily create a batch file with one copy command for each entry in my list. However, I couldn't find any x/robocopy switch or combinations of switches that will generate the folder path in the target from my source file, e.g:
xcopy dir1\dir2\dir3\file.txt copy_folder /<some switches>
xcopy dir1\dir2\dir3\file.txt copy_folder\dir1\dir2\dir3\file.txt /<some switches>
I would want it to create the path
dir1\dir2\dir3 if it does not exist under the folder
copy_folder and place a copy of
file.txt there. I understand that, on Linux
cp --parent does exactly that.
Any suggestion on the best way to achieve this is most welcome!