Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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.

filename1.docx  
filename2.docx 
filename3.docx 
...etc

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? microsoft.com/resources/documentation/windows/xp/all/proddocs/… Probably not exactly 'layman friendly' though.. :| –  mpeterson Nov 25 '10 at 0:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.