Skip to content

Understanding Windows 8dot3 Filename Aliases

Like most file systems these days, Windows lets you have rather long filenames. But it was not always so! When Microsoft first bought what was to become DOS for the original IBM PC, it used filenames consisting of 8 characters, a period and then a 3 character extension (8dot3). For example, FILENAME.EXT. This naming convention came over from CP/M (Control Program for Microcomputers) and this naming convention was also used by Atari 8-bit computer DOS and Atari ST computers (which actually used the same DOS file format as PCs).

DOS continued to use these 8dot3 names through the first versions of Windows, including the one that became super-popular: Windows 3.1. But other systems such as Macintosh, OS/2 and Unix used longer filenames. For Windows 95, Microsoft also wanted to add long filename support, but they needed to do it in such a way that software that relied on the old 8dot3 filenames would still continue to work.

Thus, the 8dot3 filename aliases were born. Each time a file was created, an hidden alias for an 8dot3 equivalent would also be created. For example, if you create a file with the name “My Long Filename.txt”, then the shortened 8dot3 alias would be “MYLONG~1.TXT”.

You can view the 8dot3 names for files by typing this in a Windows Command prompt:

dir /X

For the most part you don’t need to care about these short 8dot3 filenames. From what I’ve read, newer versions of Windows only enable 8dot3 filename aliases for files created on the C: drive. You can check your system configuration for this setting using fsutil with this command:

fsutil 8dot3name query

If you haven’t modified your system you’ll probably see:

The registry state is: 2 (per volume setting - the default)

Some seem to think that there is no point in having these 8dot3 aliases enabled and will disable them for their volumes. If you don’t want these aliases on your system you can turn them off using this command (you’ll need an Admin Command prompt):

fsutil 8dot3name set 1

Keep in mind that does not remove any previously created 8dot3 aliases. You’ll need to use the command fsutil 8dot3name strip to remove them.

The reason I bring this all up is because you might want to be aware of it if you use use the Xojo Shell with the FolderItem.ShellPath property. Normally on Windows, the ShellPath returns the 8dot3 name which works great with the Shell. But if a system has 8dot3 aliases turned off, then ShellPath returns the long path and that does not work so well with the Shell because anything with spaces will usually cause the shell command to get parsed incorrectly.

What you need to do is wrap all paths sent to the Shell on Windows with double-quotes to ensure they will still work on systems that have 8dot3 aliases turned off.

Learn more in the Xojo Documentation.

Paul learned to program in BASIC at age 13 and has programmed in more languages than he remembers, with Xojo being an obvious favorite. When not working on Xojo, you can find him talking about retrocomputing at Goto 10 and on Mastodon @lefebvre@hachyderm.io.