How can I recursively copy files of a specific pattern into a single flat folder on Windows?

mkdir targetDir
for /r %x in (*.dll, *pdb) do copy "%x" targetDir\

Use /Y at the end of the above command if you are copying multiple files and don’t want to keep answering “Yes”.

Leave a Comment