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
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.
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.
Summary: Hi all, I have been having problems writing a batch file to automate a process at work... Basically we have provided a folder for users to paste Lotus Notes archive .nsf files into which will be copie...
Summary: Here is an intresting one using a script or bat I would like to copy and rename one dir 3300 times C:\Test\49AC194E-054B-4BDD-BC6F-77F84DB2D5BE1 (49AC194E-054B-4BDD-BC6F-77F84DB200001 to 49AC194E-05...
Summary: Is 55K151AA a subdirectory of 55K139AA or is it a subdirectory of Orders. "Batch file Copy and Rename" is the subject of your post but the source and destination directory\subdirectories names don't c...