Solved Copy and rename with a text file

July 20, 2012 at 18:13:27
Specs: Windows XP
Hi Everyone,
I'm on windows XP SP3.
Everything will happen in the same folder.
one file : Original.pptx
one textfile : Keyword.txt
Keyword.txt contain names of the files to create, one name per line like this:
name number one
name two
third name
Just the names not dot no extension, as it will remain the same (.pptx).
Copy original.pptx but with new names contained in the text file.
Making as many new files as there are names in Keyword.txt (usually 50)
Which give this result:
name number one.pptx
name two.pptx
third name.pptx

I don't know if it is possible, but if someone can do this it will be of great help.
Thanks in advance.

See More: Copy and rename with a text file

Report •

July 20, 2012 at 18:40:01
Friday night, everyone's out partying!
@echo off & setlocal enabledelayedexpansion
for /f "tokens=*" %%a in (keyword.txt) do (
echo making: [%%a.pptx]
copy original.pptx "%%a.pptx"

Report •

July 20, 2012 at 20:30:11
Hi nbrane,
Yes everyone's out, it's friday night ! ! !
I need to finish this, then I 'll go out too !!!
Unfortunately I got this message (I checked for identical file names):
"system cannot find keyword.txt"
This is what I pasted in a text file I named "renamefromkeywordtxt.bat":
@echo off & setlocal enabledelayedexpansion
for /f %%a in (keyword.txt) do (
echo making: [%%a.pptx]
copy original.pptx '%%a.pptx"
I don't know anything about programming, but I tryied to make some changes to see if it could fix the problem, but with no success, of course . . .

Hope you'll find wht's no working.
Thank you so much for helping.
And go out now: it' Fri-day ! ! !

Report •

July 20, 2012 at 23:51:35
✔ Best Answer
My bad here, noticed it in your response, but it came from my post (sorry):
copy original.pptx '%%a.pptx"

should be:
copy original.pptx "%%a.pptx"

(I had unbalanced single-quote and unbalanced dbl-quote, due to typo.)
I hope this takes care of the "system cant find keyword.txt" err, but i doubt it.
First of all, make sure keyword.txt is "findable". I'm sure you've seen to that.
It needs to be, (as you said), all in one directory. (batchfile, keyword.txt, and all
files are all in same directory.) Second, and this is my bad,
for /f %%a in (keyword.txt) do (
make it:
for /f "tokens=*" %%a in (keyword.txt) do (

(to allow for those GODFORSAKEN spaces-in-filenames inflicted by MS)
See if these two fixes fix. if not, let us know. There are much smarter ones in this forum, but they're all out partying I figure. They'll be back online after recovery:(system-restore /system-refresh \\biological-unit)

Report •

Related Solutions

July 21, 2012 at 03:10:00
You know what:
Zwooooshshshhs . . . .
It was a tornado in the hard disk ! ! !
Yes, it worked !!!
Its soooo fast ! ! !
Thank you a bunch for this.
Will you be interested by a free hosting as a thank you reward ?
(I'm serious.)
If so, just let me know.
All the best to you all.

To summarize:
Create a text file, put this inside:
@echo off & setlocal enabledelayedexpansion
for /f "tokens=*" %%a in (Keywords.txt) do (
echo making: [%%a.pptx]
copy original.pptx "%%a.pptx"
rename it with extension ".bat"
Done! ! !
Say thank you to nbrane ! ! !

Report •

August 16, 2012 at 03:45:47
Hi nbrane,
I'm not sure wether you read my offer, but it sure may interest others too, if you want free hosting just read my signature and go for it.

Zero $ Cloud Hosting No Ad
Fast Secure Stable: 99% Uptime

Report •

Ask Question