Copying many files from many subfolders to a single folder

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
gruxer
Posts: 2
Joined: 23 Sep 2010 23:43

Copying many files from many subfolders to a single folder

#1 Post by gruxer » 23 Sep 2010 23:48

Hey guys, I'm brand new to batch, but there is a problem that I have. I need to get all the files with the same extension out of many folders and sub-folders that they are sitting in and put them all into a single folder of my choice. Could you please help me and show how the code should look like? Thanks a lot! (I tried searching forum for it, didn't find anything useful).

orange_batch
Expert
Posts: 442
Joined: 01 Aug 2010 17:13
Location: Canadian Pacific
Contact:

Re: Copying many files from many subfolders to a single fold

#2 Post by orange_batch » 24 Sep 2010 06:28

Code: Select all

for /r "source path" %%x in ("*.ext") do move "%%x" "target path"


.ext = file type extension

use just * for all files

gruxer
Posts: 2
Joined: 23 Sep 2010 23:43

Re: Copying many files from many subfolders to a single fold

#3 Post by gruxer » 24 Sep 2010 22:01

You said it all, It worked just fine! Thanks very much for your response.

Post Reply