PDA

View Full Version : OT: Need help with renaming files in XP


dmm
December 19th, 2007, 03:51 PM
Hey all! Some of you are quite good with computers, so here's a stumper for you. I'm trying to rename a bunch of files with names like:
0.1uJ -50 to 50 spot2f.dat
so that they are shorter, like this:
0.1uJ -50to50 spot2f.dat
but the RENAME command in XP has a bug with wildcards if you change the filename length.

For example, the command
ren "0.?uJ -50 to 50 spot??.dat" "0.?uJ -50to50 spot??.dat"
gives
0.1uJ -50to50 spotot.dat
and if I try
ren "0.?uJ -50 to 50 spot*" "0.?uJ -50to50 spot*"
then I get
0.1uJ -50to50 spotot2f.dat

This is driving me nuts! (Note that there are a lot of files, and the names and desired changes are more complicated than I'm showing here, so I do NOT want to do this manually.)

I've checked various forums and can't find this issue.
Any suggestions would be welcome.

Fyron
December 19th, 2007, 04:00 PM
Try an app like CKRename (http://www.musicsucks.com/CKSoft/CKRename/).

DOS batch commands are a horrible, horrible mess. Best to avoid them at all costs, and either use an app geared for the task, or use a scripting language like python or perl.

aegisx
December 19th, 2007, 04:07 PM
Have you tried using a FOR loop?

test.bat:

@echo OFF
for %%F in (*.*) do echo %%F

for /? also gives a lot of information about how to deal with deliminators, tokens and such. You should be able to parse it out.

Arkcon
December 19th, 2007, 04:39 PM
I use an app instead of Windows Explorer called: Explorer XP {company link} (http://www.explorerxp.com) It offers some robust renaming options. Or you could try to find some freeware renaming app.

MasterChiToes
December 19th, 2007, 05:35 PM
I recently used File Renamer, since it was free, and can be founds at download.com.
It was helpful in renaming all the SE5 planet textures and portraits I made.

StarShadow
December 19th, 2007, 08:58 PM
I highly recommend the Bulk Rename Utility. A command line version also exists, if you prefer that method.

http://www.bulkrenameutility.co.uk/Download.php

Randallw
December 19th, 2007, 10:48 PM
back when I needed to rename whole ship lists to a new empire name for se4 I searched and downloaded the following program

http://www.fauland.com/af5.htm

I haven't used it for ages but I remember it was good. You choose the files and tell it which part to change and to what.

dogscoff
December 20th, 2007, 11:58 AM
I'll throw in a another vote for ckrename (see fyron's post). I use it on my shipsets. easy to use, plenty of options, lightweight.

dmm
December 20th, 2007, 06:18 PM
Thanks for the suggestions. These are a big help!

geoschmo
December 20th, 2007, 11:57 PM
I think you can use Irfanview for batch renaming, even if they aren't image files. It sounds weird, but I'm pretty sure it works.