Ok, here we go:
for /F %a in (Files.txt) do copy /y Template.pub %a
the /F switch broadly means that the "for" command
should select something from a file or from a set of
files. Type for /? at the Command Prompt to see a
few examples.
%a is a variable that assumes different values while
the command is looping. Type the following command
to see what I mean:
for %a in (Tom Dick Harry) do @echo My name is %a.
I won't tell you what the /y switch means. Type copy /?
at the Command Prompt to see for yourself!
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> THX, works fine.
>
> For my education can u give me a short explanation
>
> /F
> %a
> /y
>
> and why does Files.txt have to be in parens?
>
> thx again
>
> On Wed, 22 Aug 2007 07:34:20 +0200, "Pegasus \(MVP\)" <(E-Mail Removed)>
> wrote:
>
>>
>><(E-Mail Removed)> wrote in message
>>news:(E-Mail Removed)...
>>>I have a TEMPLATE.PUB file.
>>>
>>> I have a .TXT file with a list of names
>>>
>>> I would like to create copies of the template file with the names in
>>> the TXT file as the filename.
>>>
>>> Is there a simple way to automate this?
>>>
>>> thx
>>
>>You could run this command from a Command Prompt:
>>
>>for /F %a in (Files.txt) do copy /y Template.pub %a
>>
>>It is possible to further automate the process by embedding
>>this command in a batch file.
>>
|