If you have one folder with multiple subfolders and you need to summarize all the files in these subfolders to the main folder, how will you do that? In fact, there are several tested methods for you to move files from subfolders to the main folder. Keep reading and try the methods with the guide steps.
Way 1: Only Move Files Using File Explorer
Using File Explorer to move files can be familiar to you. You can type a simple command line into the search box to extract all the files from all the subfolders at once. Then, move files from subfolders to the main folder easily with the following steps.
Step 1: Press Win + E to open File Explorer.
Step 2: Type *.* NOT Type:“File folder” and hit Enter.
Step 3: You can press Ctrl + A to select all files. Please note that subfolders will be listed as well. You need to press and hold the Ctrl key and left-click on the subfolder one by one to cancel the selection. Then press the Ctrl + X to cut all the selected files.
Step 4: After this, go to the destination folder and press Ctrl + V to paste them.
You can also use the Kind feature of File Explorer to find a certain type of file. For example, if you only want to move documents from all the subfolders to another folder, you can type Kind:document into the search box and hit Enter. For more categories of files, you can click Search on the top toolbar and choose the Kind option.
Bonus Tip: Check Your Data After Cutting and Pasting
You should carefully check your data after pasting files to a new destination, especially when you cut and paste files across devices, like from your PC to a USB. Files might lost due to the unsuccessfully cut-and-paste process.
If your files are lost, unfortunately, you can turn to professional data recovery software to easily recover lost files. MiniTool Power Data Recovery enjoys a high reputation among a variety of secure data recovery services. It provides multiple features to assure the accuracy of the recovered data. If needed, you can get MiniTool Power Data Recovery Free to deep scan and recover 1GB of files without any charge.
MiniTool Power Data Recovery FreeClick to Download100%Clean & Safe
Way 2: Move All Content with Windows PowerShell
Windows PowerShell is an embedded Windows tool that allows you to change computer settings, download applications, manage files, etc. You can use this utility to move all content from multiple folders to one folder quickly.
Step 1: Right-click on the Windows logo button at the left bottom and choose Windows PowerShell (Admin) from the context menu.
Step 2: Type New-Item -ItemType Directory -Path “Destination” and hit Enter. This command line is used to create a new folder to store the content you will move from the subfolders. Here I need to create a new folder named Mainfolder in E: drive; thus, the entered command line is shown in the picture.
Step 3: Type Set-Location -Path “Sourcefolder” and hit Enter. You need to replace the Sourcefolder with the path that contains the subfolders.
Step 4: Type Get-ChildItem -Recurse -File | Copy-Item Destination “Path” and hit Enter. You should change the Path parameter to the path of the folder you created in Step 2.
If there is no error notification, you have successfully copied files to the new folder.
Way 3: Move All Files Using the Batch File
You can also move files to one folder using the batch file. In essence, it is the same as running command lines in the Command Prompt while you don’t need to type command lines one by one. Follow the next steps to create and run a batch file.
Step 1: Create a new text file by opening Notepad.
Step 2: Copy and paste the following content into the text file. You should replace FolderWithSubfoldersPath with the path of subfolders and change MainfolderPath to the path of the destination folder.
@echo off
set SOURCE_FOLDER=FolderWithSubfoldersPath
set DESTINATION_FOLDER=MainfolderPath
if not exist “%DESTINATION_FOLDER%” (
mkdir “%DESTINATION_FOLDER%”
)
for /r “%SOURCE_FOLDER%” %%f in (*) do (
move “%%f” “%DESTINATION_FOLDER%\”
)
echo All files have been moved to %DESTINATION_FOLDER%.
Pause
Step 3: Click File and choose Save As.
Step 4: Change Save as type to All Files (*.*), then rename the file with the .bat extension.
Step 5: Find the batch file and right-click on it to choose Run as administrator. The Command Prompt window will open and execute the command lines automatically.
When the process is completed, you can go to the destination path to check your files.
Bottom Line
You should know how to move files from subfolders to the main folder. This task can be easily coped with this guidance. Hope it helps you in time.