Page 1 of 1

simple problem

Posted: 02 Sep 2014 01:34
by kadkam
Hi

I have a batch file that copy same file to many folders with incremental number on path.
I need to simplify the code. Can you help me?

work on this example:

Code: Select all

copy /y test.jpg 1990\test.jpg
copy /y test.jpg 1991\test.jpg
copy /y test.jpg 1992\test.jpg
copy /y test.jpg 1993\test.jpg
copy /y test.jpg 1994\test.jpg
copy /y test.jpg 1995\test.jpg
copy /y test.jpg 1996\test.jpg
copy /y test.jpg 1997\test.jpg
copy /y test.jpg 1998\test.jpg
copy /y test.jpg 1999\test.jpg
copy /y test.jpg 2000\test.jpg

Re: simple problem

Posted: 02 Sep 2014 02:07
by foxidrive

Code: Select all

@echo off
for /L %%a in (1990,1,2000) do xcopy "test.jpg" "%%a\"