Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
can anyone help me write a batch file which will rename multiple files in a given directory removing specified text from the name, as such:
"some_name[1].gif" to "some_name.gif"
"another_name[1].gif" to "another_name.gif"
etc.basically, removing in these examples "[1]" from the name.
I dont want to have to specify any part of the name, except what to remove - in this case "[1]" - from the file name, so it should use wildcard matching somehow (*.*) for the name and ext while removing the undesireable text string from the first part of the name.I tried using:
ren *[1].* *.*
but to no avail. I can get this to work:
ren *[1].* *[2].*
but I want to delete the [1], not alter it.Thanks
JFarrell471

Don't know exactly what you're using it for, but I've used this program with great success renaming loads of files:
http://www.download.com/Rename-It/3000-2248-10148114.html?tag=lst-4-15

Windows Explorer in Windows XP lets you rename multiple files with one command, but alas, only in a limited way. First highlight the files you want to rename. For noncontiguous files, hold down the Ctrl key as you click on the filenames. Then press F2 and enter the new name. The files will all be given the same name, with consecutive numbers appended to differentiate them.
You can also undo the renaming, one file at a time, with Ctrl-Z. Note that you cannot rename the extensions on multiple files at once, only change each file's name to the left of the extensio

![]() |
Guest account limiting
|
AIM and MSN Instant messe...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |