by Leo A. Notenboom
Error messages frequently include filenames of the form 'DOCUME~1' which seem nowhere to be found. They're actually there, just by another name.Question:One of the error messages I received recently refereed me to a file in thepath:
C:\DOCUME~1\MyName\LOCALS~1\Temp
Yet, when I go looking in Windows Explorer, I see nothing like thatanywhere. What’s up?
In a word: backwards compatibility.
OK, that’s two words.
What you’re seeing is the result of a legacy that dates back to Window’spredecessor, MS-DOS.
That path is there – it’s just called something else.
Without trying to sound like the old computer fogey that I actually am,“back in the day” MS-DOS only supported filenames that were at most 8characters long, followed by an “extension” of up to 3 characters, and couldnot include certain characters like spaces. Colloquially it’s often refereed toas 8.3 or eight-dot-three, and one valid example might be “explorer.exe”.
At this point I need to address all the other old computer fogeys out thereready to call me out. I know it actually predates MS-DOS, and that it’s not somuch a function of the operating system as it is the file system. Fortunatelythose details are actually irrelevant to people attempting to deal with thisissue today.
Now, that was all well and good for a long time. However, other operatingsystems, such as Unix, allowed you to have file names of much longer length.That meant it was quite valid under Unix even then to have filenames like “APicture of My Dog.jpg” – longer than 8 characters, and including spaces.
Not so under MS-DOS – or even early versions of Windows. Another example is“iexplore.exe” – it’s maxed out at 8.3, but would probably have been betternamed “iexplorer.exe” since it’s InternetExplorer, but that’s too long. In order to remain within thatolder 8.3 limitation, it was simply truncated and we’re left with“iexplore.exe”.
Eventually Microsoft added “Long Filename support” often noted as “LFN”.
“Windows will “make up” a filename for files which arelonger than the old 8.3 limit…”The problem, though, was that a massive amount of software existed thatassumed filenames would never be any bigger than 8.3. Now, one couldsimply define that those old programs wouldn’t be able to access LFNs, or onecould come up with some kind of a hack.
You can guess which option was chosen.
Those filenames you’re seeing are the result of that hack.
Windows will “make up” a filename for files which are longer than the old8.3 limit for use by programs that only understand 8.3. It does so by takingthe first part of the filename, chopping off a couple of characters at the end,and appending a tilde (~) followed by a number. The number is chosen simply toensure that the resulting filename is unique within that folder.
So what you’re seeing:
C:\DOCUME~1\MyName\LOCALS~1\Temp
is really an 8.3 representation of this path:
C:\Documents and Settings\MyName\Local Settings\Temp
which you will find on your hard disk.
So why, after all this time, are programs still reporting filenames usingthe old 8.3 filename hack? Well, many programs have been around for a longtime. One of the most common culprits I see are setup programs, which oncecreated, are often themselves not updated other than to reflect changes in theprograms that they’re installing. The result is that some setup programs oftenleave traces of the 8.3 naming convention behind after they’re done, inconfiguration files and in the registry. Those filenames are perfectly validfor any program to still use, and often end up showing up in error messages, asyou’ve seen.
What can you do about it? Pretty much nothing. Just know that when you’relooking for names that have “~” followed by a number the end, you’re probablyreally looking for a longer, more descriptive name that starts with the samethe same characters before the “~”.
Do thisSubscribe to Confident Computing! Less frustration and more confidence, solutions, answers, and tips in your inbox every week.
I'll see you there!
Posted: November 10, 2006in: ask-leo.comShortlink: https://askleo.com/2835« Previous post: How do I clear my search history in IE 7?Next post: Making the Podcast »Leo Who?I'm Leo Notenboom and I've been playing with computers since I took a required programming class in 1976. I spent over 18 years as a software engineer at Microsoft, and "retired" in 2001. I started Ask Leo! in 2003 as a place to help you find answers and become more confident using all this amazing technology at our fingertips. More about Leo.