Copy files matching wildcard combinations recursively, but donโ€™t create a directory tree in DOS

I found that I can use xcopy /s to copy all files matching the permutation combinations in a folder to another location. But this command re-creates the folder structure. I do not want a tree. I only need files dumped to the destination folder. There are no duplicate files in the source folder.

+6
source share
2 answers

You can use the for command:

 for /R %%x in (*.cpp) do copy "%%x" "c:\dest\" 

If you want to run it directly from the command line (and not from a batch file), use% x instead of %% x.

+11
source
+2
source

Source: https://habr.com/ru/post/897448/


All Articles