Copy files from folder to folder

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
jeff p
Posts: 42
Joined: 28 Jul 2009 10:21

Copy files from folder to folder

#1 Post by jeff p » 21 Sep 2015 14:49

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!

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: Copy files from folder to folder

#2 Post by Squashman » 21 Sep 2015 14:57

Code: Select all

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

Post Reply