In Windows 7, I have a directory of folders which each contain files as their contents. Is there any way to extract all of the contents of each the folders to a separate location other than cutting and pasting the content one folder at a time?
If you want to move the contents of a source directory and all of its sub-directories to a single destination directory (i.e. flatten the folder structure), it's very easy and you don't even need to bother with the command line.
Just go to the top-level source folder (whose contents you want to copy), and in the Windows Explorer search box type * (just a star or asterisk). This will display every file and sub-folder under the source folder. Now just sort by Type to group all files together, select them all, then cut/copy and paste in the destination dir.
If you have hidden and system files as well, under Organize → Folder and search options → View tab make sure Show hidden files... is selected, and Hide protected operating system files is unchecked.
12This, my friend, is why I go to SU as often as I can. DAMN FINE Feb 27, 2016 at 22:04
2The real life-hack +1 Jul 9, 2016 at 21:32
2Great answer, Would never have thought of this, I was toying with XCOPY and things and was moments away from cracking out AHK. +1.– ATacoDec 22, 2016 at 6:12
Hmm I just tried it with Windows 10 and the folders got preserved...– WJAFeb 27, 2017 at 13:43
3@JohnAndrews: Nope, still works fine in all versions of Win10 as long as you select only the files.– KaranMay 16, 2017 at 2:31
You can use Windows Command Prompt for running a command:
move C:\path\to\folder\*\* C:\path\to\folder\
I am not 100% certain about dashes, but \ or / should definetely work. The above command will move all files from all folders in C:\path\to\folder to C:\path\to\folder.
ill play around with it. i figured there was a command prompt solution im assuming for all of them id use the wildcard '*' Dec 24, 2012 at 20:34
Be warned that this will clobber any duplicate filenames.– BobJan 28, 2014 at 14:19