Information about long file names

Updated: 01/05/2018 by Computer Hope

long file namesIn the beginning, Microsoft operating systems such as MS-DOS or Windows 3.x did not support long file names like other operating systems such as Unix, OS/2, and the Apple macOS. The earlier versions of Microsoft's operating systems had a limitation of an eight character file name or directory, and a three character extension. This standard was more commonly known as 8.3 file naming convention; an example of this would look similar to the example below.


With the release of Windows 95 and the new FAT (called VFAT) Microsoft now supported long file names up to 255 characters in length as well as a three character extension. All of this was accomplished without losing backward compatibility with existing DOS volumes. Due to backward compatibility, long file names, if present, are converted by VFAT to the original 8.3 character file naming convention by each file going through the below changes.

  1. The extended characters + , ; = [ and ] are converted to underscores ( _ ).
  2. The first three characters after a period become the extension.
  3. Spaces are ignored.
  4. The first six characters now remaining are converted to uppercase.
  5. The last two characters after the first six become "~1" . If another file exists with the same first six characters and ~1, the file name will be converted to "~2"; this process will continue. In the event you have more than 9 files with the same first 9 characters, the tenth file becomes ~10, utilizing the last three characters.

Early versions of the Microsoft Windows CDs include a file called LFNBK.EXE that is not installed by default when installing Windows. However, running this file will strip long file names from the VFAT volume and store them in a text file called LFNBK.DAT.

Long file names allow users to input a complete description of their files using any characters they need, except for the below characters.

/ \ : * ? " < > |

With these new features, to access a long file name or directory such as "my long file name or directory", a user would need to use its MS-DOS short name as shown below.


How can I access long file names in Windows NT, Windows 2000, or Windows XP

Unlike earlier versions of Windows, users can access the Windows command line using CMD instead of the COMMAND command. If you open the command line from Run type CMD instead of COMMAND and you can use the full long file name instead of the short 8.3 format name.

How do I access the long file names using Windows 95, Windows 98 or Windows ME MS-DOS?

Accessing long file names can change depending upon how you have entered MS-DOS. If you are in an MS-DOS window (MS-DOS shell aka Windows command line) you can access the long file name by typing the complete long file name. If the file contains spaces or the file name or directory is longer than eight characters, place quotes around the long file name as shown below.

cd "program files"

If you have exited Windows to an MS-DOS prompt or booted from a bootable diskette, you need to use the short file naming convention. For example, if the directory you were trying to get into is "Program Files" you would need to type:

cd progra~1

Note: In later versions of Microsoft Windows (such as Microsoft Windows 2000 or Windows XP), some commands in the shell can contain spaces without being enclosed in quotes.

How can I access a long file name with spaces in an MS-DOS window under Windows 95, Windows 98?

To access a long file name with spaces, place the name of the directory or file name in quotes. An example of how to get into the program files directory would look like:

cd "program files"

How can I access a long file name sub directory without typing each of the directories separately?

If you were attempting to access the directory "Microsoft Office" in the "Program Files" directory you could type:

cd "program files\microsoft office"


cd "c:\program files\microsoft office"

I opened a file with a long file name after saving the file it was saved in the 8.3 character naming convention.

The program you are utilizing more than likely does not support the VFAT. It is recommended that you contact the developer or vendor of the software program for an updated version.

If no new version is available, you need to use the 8.3 character string format.

Long files are overwritten in a Windows 98 DOS prompt.

If the computer is booted into a command prompt or you use a Windows 98 startup diskette and use long file names, your files will be overwritten. This problem is a known issue with Microsoft Windows 98 and it's recommended when in MS-DOS to not use long file names and instead use the conventional 8.3 file format names.

Additional information