In Windows, is there a way (built in or using a 3rd party program) to bulk move all the contents of subfolders up a level? In other words, a way to get rid of selected subfolders while keeping their contents? I'd like to go from:




In a single process.


You can use a for loop in the command prompt:

for /r %i in (*) do @move "%i" .

Yes, it will try to move files in the current directory, back to the current directory, but that doesn't cause any harm. Make sure you run it while situated in the top of the hierarchy you want to move the files to. Running this from another location will have very undesired effects.

If you wish to run it so that you do not have to be in a certain directory, you can type out the paths:

for /r C:\path %i in (*) do @move "%i" "C:\path"

replace C:\path with the location of the top directory that all the files will be moved to. If you wish to run it in a batch script, change the variables to include another percent sign:

for /r C:\path %%i in (*) do @move "%%i" "C:\path"

to remove all of the empty subdirectories (from cmd):

for /d %i in (C:\path\*) do @rmdir /s /q "%i"

from batch:

for /d %%i in (C:\path\*) do @rmdir /s /q "%%i"
  • I felt forced to edit your post as what you proposed would result in pretty nasty file loss. First, using delims=? is dangerous since the default settings of console windows on Windows use raster fonts which cause every Unicode character that doesn't fit into the legacy OEM codepage to be printed as ?. And you were iterating over output ... Using for /f is the wrong idiom anyway here. for can iterate over files, recursively or directories just fine and it will correctly handle Unicode filenames even with raster fonts. 600 chars is to short for a proper explanation of the subject :-( – Joey Dec 21 '09 at 8:24
  • By the way, "delims=" is perfectly acceptable and works. You don't have to find a character that is unlikely in the output :-) – Joey Dec 22 '09 at 8:00

A simple way (in XP) is to right click on the root folder and select Search, then enter no criteria and press Search. The search results will be a flattened list of what's in the folder and subfolders. You can then just drag the results of the search into another folder and all the files will be "removed" from their folders.

In versions of Windows after XP you can achieve the same effect by just entering a search term in the search box on the top right of an Explorer Window, and then copying the results to another folder.

  • Is this Search command a right click option? And is it only in XP and not in Vista or 7? – George MacDonald Dec 22 '09 at 14:48

Loads of good suggestions so far. You could also use Everything. Right click on the relevant parent folder, "search everything". This will give a list of, well, everything in the folder. You can perform the moving operations from here, perhaps after sorting by file type, or including a file type in the search, to exclude the folders.

  • "Everything" is great. The "content" style searches in Vista onwards aren't as good as exhausted search by file name. – Matthew Lock Mar 26 '14 at 0:16

You could do this using batch files and the 'move' command.

have a read of this thread.


You can get Total Commander, which is a shareware file management program, go into your folder, press Ctrl + B (meaning branch all subdirectories - it will display all files in this directory and all subdirectories), select everything and copy to your desired location (i.e. one folder higher).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.