Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a base word file that I need to copy and name approximately 300 times. The content of the word file will be the same, but the file name will be different based on a column within excel (or a list of any kind, doesn't matter)

I've combed through things a bit, and can't seem to find any direction on how to do something like this. I would essentially like to batch copy the file, and then I could potentially use a file renaming utility, but I didn't know if there was a better way. Potentially even scripted.

share|improve this question
up vote 2 down vote accepted

Something like this could work in a Windows command shell.

Create your list of desired filenames in a simple text file:

FileNames.txt, one filename per line.


Then run the following in a command window, assuming you replace FileToCopy.docx with your actual filename.

C:\scripts>for /F %i IN (FileNames.txt) DO copy FileToCopy.docx %i

Could obviously be refined greatly, but I think this would meet your requirements. What it will do is for every line in the FileNames.txt file, it will create a copy of FileToCopy.docx with that name.

share|improve this answer
Oh wow that totally worked. Thanks man, is there a reference for that kind of thing that would be useful to a layman? – hisnameisjimmy Nov 25 '10 at 0:33
Not really sure... you could try the following?… Probably not exactly 'layman friendly' though.. :| – mpeterson Nov 25 '10 at 0:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .