Batch copy multiple folders and their subfolders to another folder

Posted by DjLenny on Super User See other posts from Super User or by DjLenny
Published on 2012-10-12T15:35:59Z Indexed on 2012/10/12 15:39 UTC
Read the original article Hit count: 332

Filed under:
|

I have a folder X:\Export that has several folders

X:\Export\Export1

X:\Export\Export2

X:\Export\Export3 etc. (names vary by a large factor)

each Export folder has the same subdirectory structure but have different files.

I would like to copy all the subfolders and the files of

X:\Export\Export1

X:\Export\Export2

X:\Export\Export3

to a folder

X:\Export\mergedExports

keeping the subdirectory structure

pseudocode of what I would like to do but cannot get working properly

create new folder "merged"
for (every folder X in a given directory Y)
copy every file in X keeping directory structure to "merged"
If conflict then overwrite

© Super User or respective owner

Related posts about batch

Related posts about batch-file