51

Can you show me how to move all files in sub-folder to the parent folder?

6
  • 1
    It is hard to imagine what type of difficulty you are experiencing. Can you explain how you are trying to do it and what doesn't work? Are you using a command line? Windows Explorer?
    – fixer1234
    Feb 7, 2015 at 1:35
  • 18
    Not sure why this was downvoted and closed as "unclear". It sounds pretty clear to me.
    – Cornwell
    May 8, 2015 at 11:03
  • 2
    HOW IS THIS UNCLEAR? @fixer1234
    – Don Larynx
    May 28, 2015 at 17:35
  • 2
    @DonLarynx: Moving files is a trivial task and there are myriad ways. Anyone would be hard pressed to be unable to find even a single method to accomplish it. The question implies that the OP has specific requirements or constraints (which are not described), that make whatever methods he tried (which are not described), unsatisfactory in some way (which are not described). That's what's unclear. If this is not a request for a solution specific to a particular problem or constraints, the question is a call to describe every possible way to move files, which is overly broad.
    – fixer1234
    May 28, 2015 at 18:01
  • 1
    In Windows PowerShell, if you are in your working folder, you can just Move .\*\* .\
    – Valdrinium
    Dec 28, 2019 at 17:57

5 Answers 5

78
  1. Make a selection of the files and folders you want to move.
  2. Right click, choose cut
  3. Go to the parent folder
  4. Right Click on some empty space and choose paste.

If the subfolder in question has multiple subfolders and you want to move all the files without their subfolder structure in tact, do the following:

  1. Press F3 to open the search dialog (or if you have Windows 7+ it will move the cursor to the search bar)
  2. Type in *.* and press enter.
  3. Wait for the search to complete. Note that it can appear to be done and then suddenly it finds more files. There is no notification when the search is complete other than a bar saying: Search again in, which appears at the bottom of the search results.
  4. Select all files using Ctrl + A
  5. Right click, choose cut
  6. Move to the parent folder by first pressing back to exit the search and then another time to go to the parent folder
  7. Right click an empty place and choose paste.
2
  • 2
    Personally, I like the batch solutions because I don't have to wait for the search function to finish. However, this is probably the easiest for a casual user. Feb 6, 2015 at 14:07
  • 1
    Genius idea for network drivers where I couldn't get the .bat scripts to work. Thanks!
    – ttt
    Apr 25, 2022 at 16:59
29

Use the 'for' command: open a command window, then use something like the following, assuming you have files in c:\foo\bar\ and want to move them to c:\foo\ :

for %F in (c:\foo\bar\*.*) do move /Y %F c:\foo

The /Y switch turns off confirmation; remove it if you want to confirm each file move.

edit: if you want to save this into a batch file and run it from the parent folder, you can, but you need to double-up the percent signs (i.e. %F becomes %%F)

6
  • 2
    for is surely a good thing to use to, but using `for /r %cd% %i in (.) do move /y %i c:\foo\bar` could be better. Sorry the code could not be formatted I don't know why.
    – Jamie
    Apr 27, 2014 at 12:48
  • Sure, /R would be helpful if there are several layers of sub-dirs that also need their contents moved. Apr 27, 2014 at 12:50
  • Hope it helps, @SnewsleyPies!
    – Jamie
    Apr 27, 2014 at 12:51
  • I'm having trouble understanding this code. I'm assuming the F used is the for command's switch for folder contents, but if so, why is it not /F rather than %F? What's the purpose of the percent sign? Nov 16, 2016 at 22:52
  • The %F is each element in the sub-folder. If you read it out it would say for each element in sub-folder, move it to parent folder and confirm confirmation dialog. Sep 22, 2019 at 10:54
10
  1. In Windows Explorer - browse to the parent folder and use the search dialog to search for * which will return you all the files in the parent and subfolders. (Or if you know you only want to return specific items from subfolders, then limit the search as you wish. For instance, if you just wanted to move .jpg files you could search for *.jpg)

  2. In the search results set it to show details and sort by the folder path column (you may have to add it to your columns displayed). This makes it easier to select all the items that are not in the parent folder path.

  3. Select all the items you want to move and drag/drop them into the parent folder.

1
  • Great solution. Thanks.
    – E Benzle
    Feb 24, 2021 at 1:36
9

From a command prompt:

Move c:\parentFolder\subFolder\*.* c:\parentFolder

1
  • 6
    This assumes only one subfolder with files that need to be extracted from it. If that was the case, the OP probably wouldn't be looking for an automated solution when they could just cut and paste in a few seconds. Nov 16, 2016 at 22:48
1

There is no out-of-the-box solution for this. Use a simple drag-and-drop technique:

  1. Select the files you want to move
  2. Drag to the destination folder
  3. Drop them
1
  • 1
    I think this answer should be removed — it's clearly wrong and does not bring anything to the conversation. Dec 14, 2023 at 10:43

Not the answer you're looking for? Browse other questions tagged .