Computing.Net > Forums > Programming > Copy and rename same file 1000 times

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Copy and rename same file 1000 times

Reply to Message Icon

Name: Neno
Date: August 17, 2009 at 18:50:53 Pacific
OS: Windows XP
Subcategory: Batch
Comment:

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.



Sponsored Link
Ads by Google

Response Number 1
Name: Wahine
Date: August 17, 2009 at 20:35:59 Pacific
Reply:

Try this:

@echo off
cls

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


0

Response Number 2
Name: Neno
Date: August 18, 2009 at 06:54:19 Pacific
Reply:

Hi Wahine,
Thanks for fast response.
For some reason files are not copied..I can not figure it out.


0

Response Number 3
Name: Wahine
Date: August 20, 2009 at 02:23:44 Pacific
Reply:

I can't pick it either, works perfect here.

No error message displayed?

Remove the > nul and see if files are copied.


0

Response Number 4
Name: gtaion
Date: August 20, 2009 at 05:24:10 Pacific
Reply:

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
)


0

Response Number 5
Name: Neno
Date: August 20, 2009 at 07:49:59 Pacific
Reply:

Yeah you are right it was quotation. Thanks a lot guys works like charm now.


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon

storing characters like ... Batch rename audio tags



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Copy and rename same file 1000 times

Copy and Rename Batch File www.computing.net/answers/programming/copy-and-rename-batch-file/15297.html

copy a file 3300 times and rename it www.computing.net/answers/programming/copy-a-file-3300-times-and-rename-it-/18821.html

Batch file copy and Rename www.computing.net/answers/programming/batch-file-copy-and-rename/18689.html