: DOS command to flatten folder structure


Jake
2007-01-25, 03:56 PM
Hey any old-school DOS experts hanging out here? I have a directory structure that has nested folders galore (manual DND not an option). All the filenames are unique and I want to flatten the tree to a single folder. I have messed around with XCOPY and MOVE but nothing is working just right. Any tips appreciated.

Basically read c:\data\*.* with recursive attributes set then move all files to a single folder c:\files.

So far,

XCOPY C:\DATA\*.* /E C:\FILES but it copies the tree structure as well. which I don't want.

Jake
2007-01-25, 04:09 PM
I just figured it out. I ended up doing a SEARCH on c:\DATA then drug the results into c:\FILES. Hey maybe this GUI thing is not so bad after-all.

Proteosome
2007-01-25, 04:53 PM
Thanks for the tip. I have had folder trees in the past that I too would like to condense. I never realized it could be so easy (assuming this works with XP).

Jake
2007-01-25, 10:43 PM
Just a followup. The Search worked just fine in XP. I searched for *.* in the folder and when the results were listed I sorted by TYPE so all the folders listed at the top. Select, then drag (not drug) the files to the single folder. Also, works great for finding duplicate files if you sort by name.