I want to copy files from multiple directories without creating the directory tree. XCOPY /S gets all the files I need, but creates the tree as well. I have more than 500 subdirectories and every folder contains files and other subdirectories. I want to copy all of the files from every subdirectory in main folder: “d:\temp1” into a new folder named d:\temp2 without creating the directory tree. Is there a way to do this without having to create a batch file containing a copy command for every folder?
Share
Ensure you are including the quotes surrounding the “A” variable and destination folder:
and/or
The testing I have done correctly accounts for embedded spaces in both folders and file names.
When your only tool is a hammer, every problem looks like a nail.