Copy a File X number of times

May 10, 2009 at 19:40:36
Specs: Windows 2003
I have a file that I would like to make X amount of copies of, I could copy and paste the file 200 times but I need to name these files

message1.xml
message2.xml

The original file is called message.xml

Could I some how do a loop ?


See More: Copy a File X number of times

Report •


#1
May 10, 2009 at 20:21:54
Not tested.

For /l %%1 in (1,1,200) do (
    copy message.xml message%%1.xml > nul
)

Or:

 For /l %%1 in (1,1,%1) do (
   copy message.xml message%%1.xml > nul
)

The first script would copy the file 200 times, the second would copy the file the number of times which you enter at the command line.

Good luck


Report •
Related Solutions


Ask Question