How to Copy Files from Multiple Sub-Folders to a Single Folder?

When importing photos from your camera or SD card via AutoPlay dialog using the Photos app, many sub-folders (month and year-wise) are created in the destination folder, which may not be what you wanted. Here is a step-by-step guide which explains how to move all files recursively from multiple sub-folders to a single folder of your choice.

For example, here is how it gets imported when using the Photos app.

Copying the image files from each sub-folder to a separate folder can be a tiresome task, especially if you have a large number of folders. However, you don’t need to dig into each and every folder to do that, as there are several ways to quickly move files from all the sub-folders to a separate folder, either using GUI or via command-line.

Move or Copy Files in Multiple Sub-Folders to a Single Folder.

Method 1: Using Command-line

Open a Command Prompt window. Use the following command-line example.

cd /d "d:\vacation snaps\2016"
for /r %d in (*) do copy "%d" "d:\all snaps"

This recursively copies all files in the “vacation snaps\2016” folder to the “All Snaps” folder.

Method 2: Using Windows Search (GUI)

Here is an option using GUI, if you don’t prefer command-line.

1. Open the parent folder (the top-level folder) which contains multiple-sub-folders.

2. From the File menu, click Options. Click the View tab

3. Enable “Show hidden files, folders, and drives” radio button

4. Uncheck “Hide protected operating system files (Recommended)”

5. Click OK.

6. In the Search box type the following search query, exactly as below:

*.* NOT kind:=Folder

7. Just make sure that All subfolders option is enabled. It starts searching for files in all sub-folders and recursively, listing them all including the ones with System or Hidden (or both) attributes. We use the “NOT” operator to prevent Windows search from listing sub-folders — as we’re only going to copy or move all the files in sub-folders, and not the folders themselves.

8. Wait until the search is completed, and then select all files in the search results, by pressing CTRL + A.

9. In the Home tab, and click the Copy To button. If you want to move the files instead of copying, click the Move to button, and click Choose location…

10. In the Move Items dialog, select the folder where you want to move all the files. To create a new folder, click Make New Folder button and assign the folder name accordingly. Once selected the folder, click Move.

This moves all the files recursively from the multiple sub-folders to the destination folder chosen.

Making sure every file has been moved successfully

Important: Windows Search may not list every file in search results in some cases, either due to indexing issues or if “Temporary” attributes is set for a file. First, it’s prudent to make sure that there are no files left behind at the source location, before clearing out those folders.

To verify that, right-click the parent folder (or select all sub-folders and right-click) and click Properties. If it says 0 Files, then everything has been successfully relocated to the new location, and the folders in the old location can be deleted.

That’s it! This post takes the case of photos imported from camera, but the procedure to move all files from multiple sub-folders to a separate folder is the same for all file types.