Copy and rename same file 1000 times

August 17, 2009 at 18:50:53
Specs: Windows XP
Hello everyone,

I have been trying to create a Bat file that will copy the same file test.avi from directory F1 to F2 1000 times and
rename each time to new file name for example test1.avi, test2.avi..and so on until reach 1000 copies, so last renamed copy would be test1000.avi. If anyone can help me do this that would be great.


See More: Copy and rename same file 1000 times

Report •


#1
August 17, 2009 at 20:35:59
Try this:

@echo off
cls

for /l %%# in (1,1,1000) do (
    copy F1\test.avi F2\test%%#.avi > nul
)


Report •

#2
August 18, 2009 at 06:54:19
Hi Wahine,
Thanks for fast response.
For some reason files are not copied..I can not figure it out.

Report •

#3
August 20, 2009 at 02:23:44
I can't pick it either, works perfect here.

No error message displayed?

Remove the > nul and see if files are copied.


Report •

Related Solutions

#4
August 20, 2009 at 05:24:10
If you are using long filenames (Filenames or directories with spaces or that are longer then 8.3), i.e. C:\documents and settinging\guest\desktop\f1, You need to enclose the path in double quotes, so the above code would simply be.

@echo off
cls

for /l %%# in (1,1,1000) do (
copy "F1\test.avi" "F2\test%%#.avi" > nul
)


Report •

#5
August 20, 2009 at 07:49:59
Yeah you are right it was quotation. Thanks a lot guys works like charm now.

Report •


Ask Question