Joey's above worked for me, but i did have to experiment with it a bit and-so this answer/reply, is just for clarification / explanation for those unfamiliar / intimidated by using commands, and to help avoid/explain a problem i had USING it so hopefully you won't :) ;
(in my case i was needing to merge files of an artist's music tracks, into a single directory since my players simple lists were all being screwed around with by windows media-files special-behaviours! removing artist / albumn when i didn't want it to! eyes roll )
Anyway, starting with his ;
" for /r C:\Folder %f in (*.png) do @copy "%f" C:\png "
the "C:\folder" bit,..
... is where you specify which folders are to be seached-through for files to-then leave only-the-files, but-not-directories, FROM...
and
the "C:\png" bit,..
... is where you want the files without directories,.. to-GO.
ex ;
...\KarlK\ (this is where i was in cmd - where the prompt was)
what worked for me, when i was wanting to add all the subdirectories' tracks into a single folder, in a directory before this one, called "allinONE" ... was ;
( by the way, .aiff files are music files just so you know what you're looking at )
FOR /r . %f IN (*.aiff) do @copy "%f" ..\allinONE
NOTE that because it cannot complete a "cyclical" search, you need to have the destination ELSEWHERE,.. than in subdirectories being-searched-THROUGH or to-be-searched-through you might say,.. before it will allow the search/copy - that's why i've got my destination in a
' ..\ ' directory,
'higher', or 'before' it - further 'BACK' towards the c: root.
(in other words, if you have it AFTER where it's to be searching through, it'd go loopy )
if you do that, AND have the cursor/cmd prompt ... in the directory where you want to search-FROM ... so say your music files are both loosely in the starting directory AND in subdirectories,.. then this is OK.
if you're OK with searching through a target-directory somewhere ELSE, other than the current directory, then you should have a complete(full length) location, and not "." as i did - again, if you're unfamiliar with tricks in DOS, then yes, that actually works, but if you'd prefer both full-length locations, then there's nothing wrong with that :)
if you ONLY wanted to use ones in subdir.s, but-NOT those in the current dir, this will NOT work - temporarily moving those in the starting-directory somewhere-else first should, but i'm sure someone aware of how to add some additional flag or operator or something, could improve on this answer :) If you're happy to type in both locations in a reliable FULL way, then ignore this last point.
in case you're wondering, do-not specify file types for the destination - just specify a directory(location to be coptied-TO ) - the filtering you might say ... happens at the point where i've got (*.aiff)
good luck!