Rename one image into 100's of different names and save into a folder

Rename one image into 100's of different names and save into a folder.

I have a need to name 1 image i have in a folder into 100's of different names and save them into the folder

I have the names in a txt file as

Jerald-Gabriel.jpg
george-sam.jpg
etc etc

So need this one image to be saved as in different names i have in a txt file all into 1 folder

Any help with some script please
mtthompsonsAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Wayne Taylor (webtubbs)Commented:
Try this...

Dim fso, fileNamesFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set fileNamesFile = fso.OpenTextFile("P:\test\ImageNames.txt", 1)
Do While fileNamesFile.AtEndOfStream <> True
	fso.CopyFile "P:\test\Image.jpg", "P:\test\" & fileNamesFile.ReadLine
Loop

Open in new window


....where "P:\test\ImageNames.txt" is the path of the text file and "P:\test\Image.jpg" is the path of the original image.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mal OsborneAlpha GeekCommented:
Either that, or concatenate commands in Excel, spit the results out as a text file, rename .CMD and run it.

You need a column to contain 100s of lines that just say "copy  image.jpg username.jpg" or whatever.

If you are unsure how to do this, begin with "Formula, insert function, concatenate"
Bill PrewIT / Software Engineering ConsultantCommented:
Pretty easy to do this at a DOS command prompt, not really worth a script.  Just open a command prompt, do a CD to the folder where the files and text file are, and type the following command:

for /f "usebackq tokens=*" %A in ("yourtextfile.txt") do (@ECHO copy "imagetobecopied.jpg" "%~A")

Open in new window

It is in test mode, so will only display the copy commands it would have executed.  If it looks like it is copying the right files, run again without the ECHO, like this, to do the copies.

for /f "usebackq tokens=*" %A in ("yourtextfile.txt") do (@copy "imagetobecopied.jpg" "%~A")

Open in new window

Naturally put the real file names of the master image, and the text file into the command when you run it.

~bp
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.