Change filenames en masse



Q Can I change a group of filenames with one command? Say I have ten files in a folder; can I rename them from file1, file2, file3, and so on to misc1, misc2, misc3, etc?
- John Whitten

AYes, as long as you've been using short, DOS-compatible filenames -- those that are no more than eight characters long and don't contain spaces or the characters \ / : * ? " < > |. Also, all of your filenames must have a text string in common. The example you gave me fits both criteria, since all the names are five characters long, contain only numbers and letters, and start with the word "file".
To rename your files, go to a DOS prompt and change to the directory where the files reside. There, use the ren command to rename the files. The command's syntax is ren oldname newname, and you should use the DOS wild cards ? (for any character) and * (for any string of characters) to represent the parts of the filenames that vary. So if you want to rename file1.rpt, file2.rpt, and file3.rpt to misc1.rpt, misc2.rpt, and misc3.rpt, you'd use the command ren file?.rpt misc?.rpt. For your example, use ren file* misc*.
In theory, a DOS session running inside Windows 95 understands long filenames, but in this case the theory doesn't work. A long filename containing a wild card will just confuse DOS. If you've got long names you want to change en masse, you'll need a program like Kent H's Rname-it. The interface is clunky, but it works fine and it's free -- and unlike anything put out by Microsoft or Lotus or Netscape, Rname-it doesn't alter Windows when you install it. You can find the program at http://trailerpark.com/phase1/next/fileutil.html and on our cover CD.



Rename several files in one step, even those having Windows 95's long filenames, with Rname-it


- Lincoln Spector


Category: Win95
Issue: Apr 1998

These Web pages are produced by Australian PC World © 1997 IDG Communications