Windows 95 "Friendly" Short Filenames
Can Be Dangerous!

28 January 1998

You may be aware that Window 95 uses a scheme to map "long" filenames to "short" (old-fashioned "8.3") filenames. You can see both long and short filenames by looking a file's properties (right-click a file in the Win95 Explorer, then click Properties, and see its "MS-DOS name"), or by executing the DIR command in an MS-DOS window.

For example, a file whose long filename is "ThisIsATest.txt" appears in DOS as "THISIS~1.TXT". (If you then create another file named "ThisIsAnother.txt", it will appear in DOS as "THISIS~2.TXT".) This applies to long extensions too: a file named "Test.html" appears as "TEST~1.HTM".

If you sometimes do work in MS-DOS mode, you may feel that these short names are ugly, and I find it annoying to have to type those tildes.

Several Windows 95 "tip" sites offer a method of improving the naming scheme, generally referred to as "friendly short filenames". Following their advice, I reconfigured my system as follows:

  1. Run the Registry Editor (REGEDIT.EXE)
  2. Drill down to HKEY_LOCAL_MACHINE\System\CurrentControlSet\control\FileSystem
  3. Select New from the Edit menu, and then choose Binary Value
  4. Type NameNumericTail and press Enter
  5. Double-click on NameNumericTail, enter 0 (zero), and press OK
  6. Restart Windows 95

Now, a newly created file named "ThisNameIsLong.txt" appears in DOS as "THISNAME.TXT", and "Temp.html" appears as "TEMP.HTM". File names and extensions are simply truncated to 8 and 3 characters, which is much more intuitive and more to my liking.

(When a conflict arises, Win95 reverts to using the tildes and digits -- subsequently created files named "ThisNameIsLonger.txt" and "ThisNameIsEvenLonger.txt" appear as "THISNA~1.TXT" and "THISNA~2.TXT". But at least we got one decent short filename!)

So I thought I was all set -- until I began to notice unexpected warnings from application programs about replacing files that "already exist" when they in fact did not already exist!

Suppose you create a file named "ThisFile.htm". Win95 assigns it the short filename "THISFILE.HTM". Fine so far. Then create a file named "ThisFile.html". Win95 would like to shorten this to "THISFILE.HTM", but notices that such a short filename already exists, so it assigns the short filename "THISFI~1.HTM". No problem.

But if you do this in reverse, here's what happens:

Suppose you create a file named "ThisFile.html". Win95 assigns it the short filename "THISFILE.HTM". Fine so far. Then you create a file named "ThisFile.htm". Win95 does not need to shorten this name -- it will use "THISFILE.HTM" as the short filename. But it sees that such a short filename already exists, and prompts for replacement. Gotcha!

Why? Well, I'm guessing here, but... Apparently Win95 has different routines for handling files that are already in short form versus those that require a short/long name pair. When a filename is already short, Win95 only checks the short names of other files for possible collisions. If it was also checking short names against long names then the problem wouldn't occur because it would realize that "ThisFile.htm" didn't really match "ThisFile.html".

So... I recommend that you go back into REGEDIT.EXE and delete the NameNumericTail value from the HKEY_LOCAL_MACHINE\System\CurrentControlSet\control\FileSystem key!

Thanks to John Conde at WinZip Technical Support for working through this with me.

You are visitor [Odometer] since 28 January 1998

Copyright © 1998 Rex Swain
E-mail, Web