command line

Making multiple copies of one file… in Windows

It took me a long time to figure this out, but once I did, it proved very useful for a particular project. I was not able to find a free program that would create multiple copies of one file for me, and I didn’t want to mess around with anything that seemed too complicated (scripting). Doing it manually in Windows was simply too stupid, frankly; and Windows doesn’t have Automator, like Mac. But I discovered that this can be done from the Windows command line.

All you need is one copy of your file, named 1 (dot) extension. In my case, it was 1.jpg.

Then you bring up the command window, go into the folder where the file is located, and type this command:

for /l %f in (1,1,800) do copy 1.jpg %f.jpg

You can change 800 to however many copies you need. So in that example, the command would have generated 800 files, named sequentially from 1.jpg to 800.jpg. Super fast! Basically, it’s a loop process of the copy command.

I figured this out thanks to reading this thread at Webmaster World, which seriously saved me a lot of time and effort. Makes me want to learn more cool command line operations. One day…