Remove extra extention from a large number of files???

  • Thread starter Thread starter Noozer
  • Start date Start date
N

Noozer

Windows XP Pro SP1... Is there any way to remove the filename extension from
a large group of files?

I have a whole bunch of files named "filename.bin.txt" in a directory and I
need them renamed to "filename.bin"... I can't seen to figure out the
command line that would accomplish this.

Help?
 
Nobody can help with this simple task?

If it can't be done natively, are there any third party apps that can do
this?
 
Dropping some files on this will remove the last four characters from the
name of the files.

--drop_files_to_rename.js--cut here--
function rename()
// by Mark L. Ferguson 12/2004
// removes last 4 chars from filename of dropped files
{ var fso = new ActiveXObject("Scripting.FileSystemObject");
var Ag = WScript.Arguments;
var f,s;
for(j=0; j<Ag.length; j++)
{
f = fso.GetFile(Ag(j));
s = f.Name;
s = s.substr(0,s.length-4);
f.Name = s;
}
}
rename();
--cut here--
 
David, I think you're a great problem solver, and I don't want to sound
critical, but that command has some 'recursive' thing that removes Both
extensions. (I really don't know how to stop that. I wrote the script as my
attempt at a workaround for that.)

What's really funny is the actual reason for the request. :)
('filename.jpg.dat' posted in all the '..binaries.. groups as an attempt to
avoid censorship)


"David Candy" <.> wrote in message
For %A in (*,*) Do ren "%~A" "%~nA"
 
Nope.. they really are *.bin.txt

....haven't gotten around to trying out your script. Looks like fun.

..js will run from the command prompt/Windows Explorer???

Thx!
 
Well, yes a command prompt will allow you to type in "rename.js *.*" if you
want, but highlighting all and dropping them on the JS file would work too.
 
Back
Top