With a batch (.bat), I want to copy all mp3 files that are in 1 subdirectory of D:\TEMP
D:\TEMP\\(anyfolder)\\(anyfile.mp3)
to
E:\MYFOLDER\
I tried with xcopy but
I don't know how to tell "just recurse subfolders of D:\TEMP and not subsubfolders, subsubsubfolders, etc."
When using xcopy, folders are created in the destination (in order to replicate source's folder tree), I don't want this : files should be copied in just 1 single folder.
for
command is your friend. Read help for
and then try this in the command prompt
for /d %a in (*) do @echo %a
as you see, it follows all subfolders in the current directory.
thus,
for /d %a in (*) do @copy %a\*.mp3 e:\myfolder
will copy all your mp3 to the destination folder.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With