Program to rename 4 files to another 4 files with same extension?

travanx

[H]ard|Gawd
Joined
Apr 9, 2000
Messages
1,579
I used a program called winfile.exe that only works with Windows 98 that could rename files very easily. Say I had 2004.txt, 2004.nfo, 2004.now and I wanted to rename those all to 2003.txt, 2003.nfo, 2003.now. Is there some simple program that can do this in Windows XP? or an easy way to create a batch file to do this? Something simple and free would be perfect. Thanks for any help.
 
Right click on the file and choose rename maybe? Seems to work for anything I want to rename.
 
no but to do it in groups of 4 files at once. Its hard to explain. but renaming means I need to rename each file 4 times. winfile.exe which i think came with Windows 98 let me do the 4 files in one shot.
 
does 'rename 2004.* 2003.*' work? i'm not entirely sure on that.

i know that 'rename *.doc *.txt' works for example
 
yes that rename blah*.* blahblah*.* works.

Now how can I make a simple batch file to let me choose a directory first where the files are located. Then let me do a copy blah*.* to blahblah* to a certain directory I choose to store them in?

since the rename and copy both work the way I want, and I really want to make a copy of these files like that.

BTW thanks for the rename wildcards.
 
Kinda busy to do it myself... but this'll help in you writing the bat file...

My understanding though is that if you have a batch file called r.bat and use it like thus:

c:\> r bob c:\fred

you can access the arguments with %1 %2 and so forth ie
copy %1.* %2
in this case resolves to
copy bob.* c:\fred

so... that should help :)
 
using that batch file of bob.* to c:\fred how would I type it to copy bob.* to c:\fred\john.*? Thats exactly what I need btw. Thanks!!!!!
 
Erm... well... here we go:

save as vcopy.bat
Code:
rename %1\%2.* %3.*
copy %1\%3.* %4

It is then called like this:
vcopy <full path of original files> <prefix of original files> <prefix of new files> <full path of where to copy>

e.g.:

Code:
C:\bats>vcopy c:\bats\a t s c:\bats\b

renames t.* in c:\bats\a to s.*
copies all s.* file sin c:\bats\a to c:\bats\b

You then have two copies of the files... if you want to automatically delete the first... I'll let you put that in because I don't want to be responsible if it goes wrong.

Making the last line of the file del %1\%3.* would possible help there... but I haven't tested or even thought much there, be careful.

Marvellous.
 
ok another thing to try to add, trying to see how functional I can make this with staying at the command prompt. and I won't need to delete anything.

I would like to list all the files in a directory according to a user inputted filename. So I would let it do a dir of all the files like 01100*.* and it lists all the files. maybe about 10 files.

Now I want to let the user pick if they want the files that say 01100sv.* , 01100bk.* or 01100tm.*
so maybe an option of sv, bk, or tm after listing the directory.

and then do the copy command to let it be renamed 02100bk.* 02100sv.* or 02100tm.* depending on which sv, bk, or tm they pick.

all while being able to pick the original directory and save directory. I know that sounds really complicated and so far the help in this thread is so helpful. I get confused really easily when trying to figure out batch files and the wildcard settings.

So an example.
- user lists 01100*.* and it gets listed.
- user sees they want the 01100tm.* files to be copied to a new file name so they choose from the options (tm,sv,or bk) to use the tm
-user inputs new file name like 02100tm.* and wants those 01100tm*. files from the 2001 directory copied to the 2002 as 02100tm.* directory.

Hope that makes sense.
 
1) Maybe batch files aren't the thing
2) We seem to suffering from goal creep

I tell you what. You write out a complete and detailed description of what exactly it is that you want and I'll see if I can make you a nice little GUI windows program that does it.
 
I used a program called The Rename and it worked in Win2K (I can't remember if I used it in XP or not).
 
Haha, yeah well what I posted was what i thought I wanted it to do. But then I noticed there was another thing I wanted. And then I found out I need it to do a little more than originally thought.

Ok right now I am using winfile.exe which I think comes with win98 but won't work on XP. So this is what happens.

The user goes to their directory. Looks for their files. And selects the 4 files they want. Say 01100.crd, 01100.idx, 01100tm.pl1, 01100tm.pl2 in a 2001 directory.

Then after that they choose to copy the files which gives them a box that opens to type in the new file name. So the user types 02043*.* and this now puts these files copied and renamed into folder 2002. So in the 2002 dir it has 02043.crd, 02043.idx, 02043tm.pl1, 02043tm.pl2.

Now that tm could be a bk, tm, or sv. You wouldn't believe how helpful it would be if you could write a little gui for this?

Originally posted by vinnie
1) Maybe batch files aren't the thing
2) We seem to suffering from goal creep

I tell you what. You write out a complete and detailed description of what exactly it is that you want and I'll see if I can make you a nice little GUI windows program that does it.
 
I'll try and get it done within the next 12 hours or so from this post :)
 
very impressive. You wouldnt believe how helpful your little program would be. Any chance I could see the source code, even if part of it if you dont want to give me the whole thing? I am curious how it looks.

i actually had to h*a*c*k a stupid part of the program this is for, to work too with our stuff. Because the windows part of the program needs a program to see a dongle, but the dos part slows down if I install that special thing. And the lame company won't fix the problem even though there is a newsgroup devoted to trying to fix it. I hate dos programs within the window environment.
 
I didn't bother to read the replies to this post so I don't know if you figured out a way or not. Because, I'm going to tell you what I do anyway just because it's SOOOO COOOOL!

I use Magic File Renamer 53B. Once you learn it, you can litterally rename HUNDREDS or THOUSANDS of files ALL AT ONCE in an INSTANT to whatever new name and stream of names you give it!! It's so nice man. You can change just one simple character in the file name like you're talking about if that's all you want too. You can use this program in very simple ways, and i've learned you can use it in very complex ways as well. Try it man. It even puts itself in the context menu for quick file renaming. I use this program for renaming my hundreds of pictures from the digital camera, hundreds of downloaded pictures (not prOn, i don't bother to rename those, lol), and also for ripped cd tracks and such. It RULEZ!!!!!
 
The wheels fell off that idea. [H] was dead for the whole day literally just after I posted, couldn't even read what I was supposed to be doing... then forgot about it o_O

Here I am though, I'll hop to it :)
 
Lollerberries.. I can't get rename to work. Everything else works fine, just the actual rename is fu><0red. I've got *no* idea where to go from here.

From the command line in the right directory, this works fine:

rename y*.* x*.*

The program generates and tries to run this:

cmd /c rename C:\bats\a\y*.* x*.*

But it fails...

From the start->run , cutting and pasting what the program generates works... but the program itself won't execute the command properly :D

It either renames nothing, or it will rename some of the files, sometimes 2, sometimes 3... I'm yet to work out a pattern.

Here's the code:

Code:
strToDir = "cmd /c rename " + strNewLocation + "\" + fileprefix + "*.* " + strNewPrefix + "*.*"
    Shell (strToDir)
    ttt.Text = strToDir

New location is a path, fileprefix is the file prefix, new prefix is what the new prefix is. Shell executes the command, ttt is just a textbox so I can see what's being generated.

Mm... here's an idea... the command is being executed right after the cmd /c that copies the file, maybe the write isn't finished before it tries to rename... lets look into that.

Anyhow, there is only this little thing in the way at the moment...
 
Ok tried it out, the rename doesn't work like you said. Ok now that I see what you got. Is there a way to select the files from the list to rename? So I could hold ctrl and click what I want changed?
 
o_O The rename works fine as long as your new prefix isn't any longer than the old one i.e. if your files are 2003.a 2003.gh 2003y.z , then your new prefix can be at most four characters. That's just how rename works.

As for picking the ones you want to rename in particular... I thought we were group renaming?
 
it is somewhat a group rename. but basically there could be 15 files of similiar prefix in the dir. and I only want to change 4 of them. now seeing what you did, it seems like its possible to select the 4 files I want from my dir to change to another file name. I guess its hard when I wasn't sure what you were going to output, and at the same time you weren't exactly sure what I wanted. But definately I am going to give it another try to figure it out.
 
Righty-o. I wasn't told this before o_O. Excluding files. Interesting.

Alright, I'll see what I can do over easter, kinda busy now.
 
Just in case you forgot about this thread. If you come up with anything please let me know. Thanks again.
 
dude, im telling you man, download magic file renamer. it does everything you want it to do and some. requires a little bit of learning and trial and error to master it's full potential, but once you do, you can do anything you want to any number of files and their names.
 
Ok I tried installing that renamer. Can you give me some tips on how to use it with what I am doing? Rename 4 files I selt to a different year basically? Which option do I pick at the top? I see trim, formatter, etc..
 
ok using magic file renamer. I figured out to use the replacer filter. That works exactly like I wanted!!!!!!!!!!!!!!!!!!!!!!!!!!!! Thank you so much. Now the next question is, how do I put a filter to copy this file to somewhere I want? And thanks for everyones help, I really appreciate it.
 
this is really stupid, but I found winfile.exe that works on Windows XP from a registry tweak site. I can't believe there is an updated one.
 
Back
Top