How to Move or Copy Files in Multiple Sub-Folders to a Single Folder and Output Result to .txt

Method 1: Using Command-line

Open a Command Prompt window. Use the following command-line example. cd /d "d:\ snaps\2020" for /r %d in (*) do copy "%d" "d:\all snaps" This recursively copies all files in the “ snaps\2020” folder to the “All Snaps” folder.

Method 2: Using Windows Search (GUI)

Open the parent folder (the top-level folder) which contains multiple-sub-folders. From the File menu, click Options. Click the View tab

subfolder files move

save as .bat this will move all the files in the subfolders to one folder FOR /R "C:\test move\test" %%i IN (*.*) DO MOVE "%%i" "C:\destination" pause

Output result to .txt

>> c:\Results.txt add this at the end of for /r "c:\source_directory\" %%x in (*.pdf) do move "%%x" "c:\target_directory\" >> c:\Results.txt

109 views0 comments

Recent Posts

See All