simple problem

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
kadkam
Posts: 14
Joined: 26 Aug 2013 06:32

simple problem

#1 Post by kadkam » 02 Sep 2014 01:34

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

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: simple problem

#2 Post by foxidrive » 02 Sep 2014 02:07

Code: Select all

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

Post Reply