I am trying to create a batch file to copy files of one extension type from numerous subfolders to a different folder. I am using this command:
xcopy *.mp3 destination /s
It isolates the files and copies the files, but creates the subfolders too. Is there another option that would place the files in only ONE destination folder (no subfolders)?
Copy Files with Same Extension from Subfolders
Moderator: DosItHelp
Re: Copy Files with Same Extension from Subfolders
johnbil wrote: ↑07 Sep 2018 10:51I am trying to create a batch file to copy files of one extension type from numerous subfolders to a different folder. I am using this command:
xcopy *.mp3 destination /s
It isolates the files and copies the files, but creates the subfolders too. Is there another option that would place the files in only ONE destination folder (no subfolders)?
Code: Select all
FOR /R "C:\source folder" %%G IN (*.mp3) DO copy "%%G" "C:\destination\"
Re: Copy Files with Same Extension from Subfolders
Thanks, Squashman. That did it.