Changing file names automatically
Discussion
I'm sure there's a relatively straightforward way of doing this, but it sure isn't something I've done before....
I've got a bunch of files called *for example*:
filename_morefilename.jpg
I want to change the filenames to:
filename_date_morefilename.jpg
But there are almost 200 files, so I'd like to do it using windows scripting or batch file - can it be done, and if so does anyone know how? A virtual beer (or a real one if your near me!) and many thanks to the winner!!
I've got a bunch of files called *for example*:
filename_morefilename.jpg
I want to change the filenames to:
filename_date_morefilename.jpg
But there are almost 200 files, so I'd like to do it using windows scripting or batch file - can it be done, and if so does anyone know how? A virtual beer (or a real one if your near me!) and many thanks to the winner!!

I'm thinking that you want to use the "VBA FileSystem" object to copy the files to a new location, under the new name, then, all you have to do manually is to check it did it OK, delete the old files, and copy the new ones back to where the old ones were.
Use MS excel, open up the macro editor, and launch the object browser and do a search on FileSystem.
Unless you actually have a standalone copy of VB, it's a great way of writing and debugging VB, which under XP you can then run directly from the command line.
Use MS excel, open up the macro editor, and launch the object browser and do a search on FileSystem.
Unless you actually have a standalone copy of VB, it's a great way of writing and debugging VB, which under XP you can then run directly from the command line.
Or you could use the Magic File Renamer
I have been using this tool for many years for automating renaming tasks. Beware, it is very powerful and you may get some unintended results if you are not careful.
You can get a free demo of the current version or if you click the previous versions button on the left of the page, you can pick up the free version.
I have been using this tool for many years for automating renaming tasks. Beware, it is very powerful and you may get some unintended results if you are not careful.
You can get a free demo of the current version or if you click the previous versions button on the left of the page, you can pick up the free version.
tycho said:
Could do a dir into a file and then open it in excel which would allow you to concatenate and split filenames, then put into notepad and save as a batch file. Maybe a long way of doing it but this is what I did with a load of MP3s which needed the track numbers removing.
Did it quick and dirty way:
dir >filenames.txt
open in excel space delimited, remove unwanted rubbish and create extra columns around the original filename list, in col 1 "ren", col 3 "filename + required text added using ctrl+h". Save then open text file in notepad, ctrl+H replace the tab spaces with normal spaces and resave as filename.bat. Run! Works fine!
arcturus said:
Or you could use the Magic File Renamer
I have been using this tool for many years for automating renaming tasks. Beware, it is very powerful and you may get some unintended results if you are not careful.
You can get a free demo of the current version or if you click the previous versions button on the left of the page, you can pick up the free version.
Downloaded - used! Explorer seems a little unstable now though.
jimothy said:
This is what I love about IT...
Ask 100 IT bods how to solve a problem, and you'll get 200 solutions...
More like 37 solutions, 43 people who misunderstand the question, 17 who answer a completely unrelated question, 26 who say you shouldn't be doing it like that, 12 who say you should be using a Mac/Linux/Windows Vista/VMS/MVS-XP instead, 13 people selling porn, viagra and "college degrees" and a request to launder $30M for Sonny Abacha's son/widow/chaffeur.
(Yes, I know it doesn't add up. The classes overlap...)
Option number 101 ....
Try this little freebie.
I haven't used it much - found it when seeking a solution for someone else - but it works well in testing and I can see a need coming up for renaming several thousand photos ...
He also does some other rather useful utilities.
www.fauland.com/af5.htm
Try this little freebie.
I haven't used it much - found it when seeking a solution for someone else - but it works well in testing and I can see a need coming up for renaming several thousand photos ...
He also does some other rather useful utilities.
www.fauland.com/af5.htm
Gassing Station | Computers, Gadgets & Stuff | Top of Page | What's New | My Stuff


