1980Views6Replies

Author Options:

Batch file to copy files Answered

Some body help me to create batch file which can copy files from a folder one by one into many folders. For example if one folder has 10 files then I have to copy those files (one in each) in each subdirectory of a given directory.

6 Replies

user
Prof. Pickle (author)2012-12-14

Ummm... I know this is an old post, but I think I may have found some of your solution.

FOR /​R [path to the files you want copied] %%I IN (Files you want copied) DO COPY [files you want copied] [place where you want them copied]

Select as Best AnswerUndo Best Answer

user
Goodhart (author)2008-03-22

It would be easier to do that manually I am afraid

Select as Best AnswerUndo Best Answer

user
caitlinsdad (author)Goodhart2008-03-22

"Think smarter...not harder..." quote from somebody

Select as Best AnswerUndo Best Answer

user
caitlinsdad (author)2008-03-22

Oh, I forgot, if you can figure out how to create the batch file, I will leave it up to you on how to execute or run the file...:)

Select as Best AnswerUndo Best Answer

user
caitlinsdad (author)2008-03-22

If in Windows, create a xxxx.bat file with notepad. You can add commands for each line to copy the file from where it is to the location you specify. It would be easier if the filenames and directories had some common namepart so you can use wildcard characters. You can also rename the files if needed. You can search "DOS batch file" for other commands or this one which came up in the search for a primer here. Learn how to do batch files and you are on your way to becoming a good programmer...

Select as Best AnswerUndo Best Answer

user
Noodle93 (author)2008-03-22

You use: COPY "C:\Target\Address\example.txt" "C:\New\Location\example.txt" I believe.

Select as Best AnswerUndo Best Answer