Page 1 of 1

Copy files from folder to folder

Posted: 21 Sep 2015 14:49
by jeff p
I have this simple script that copies files from one folder to another.

Code: Select all

xcopy Z:\Files_From\Folder_1\*.tga "Z:\Files_To\Folder_1\"
xcopy Z:\Files_From\Folder_2\*.tga "Z:\Files_To\Folder_2\"
xcopy Z:\Files_From\Folder_3\*.tga "Z:\Files_To\Folder_3\"
xcopy Z:\Files_From\Folder_4\*.tga "Z:\Files_To\Folder_4\"

etc..

Both the source and destination. folder are labeled the same way.. ie Folder_1, Folder_2, Folder_3, ...up to Folder_468.

Is there a more efficient way for copying these images?

Thanks!

Re: Copy files from folder to folder

Posted: 21 Sep 2015 14:57
by Squashman

Code: Select all

 FOR /L %%G IN (1,1,468) DO xcopy "Z:\Files_From\Folder_%%G\*.tga" "Z:\Files_To\Folder_%%G\"