Microsoft KB Archive/101601

From BetaArchive Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
Knowledge Base


Converting Filenames from NTFS to FAT (8.3) Convention

Article ID: 101601

Article Last Modified on 11/1/2006



APPLIES TO

  • Microsoft Windows NT Advanced Server 3.1
  • Microsoft Windows NT Workstation 3.1
  • Microsoft Windows NT Advanced Server 3.1



This article was previously published under Q101601

SUMMARY

The Windows NT filesystem (NTFS) supports filenames up to 255 characters long. In most cases, NTFS also generates an MS-DOS compatible filename in 8.3 (filename.extension) format that allows an MS-DOS-based or 16-bit Windows-based application to access the same files.

NTFS translates a long filename to an 8.3 filename in the following manner:

  • NTFS deletes any illegal characters from the long filename and removes any spaces. The resulting filename must be a letter or a number and it must not contain the following illegal characters:


. " / \ [ ] : ; = ,

If the filename contains any of these characters, unexpected results may occur. The resulting filename cannot contain any spaces.

  • Because an 8.3 filename can contain only one period (.), NTFS removes additional periods from the filename if valid, non-space characters follow the final period (see Example 1 below). Otherwise, NTFS ignores the final period and uses the second to last period (see Example 2 below).


Example 1: This is a really long filename.123.456.789.txt converts to THISIS~1.TXT

Example 2: This is a really long filename.123.456.789. converts to THISIS1.789

  • NTFS truncates the filename, if necessary, to six characters and appends a tilde (~) and a digit. For example, each unique filename created ends with "~1". Duplicate filenames end with "~2", "~3", and so on.
  • NTFS truncates the filename extension to three or fewer characters.
  • NTFS translates all characters in the filename and extension to uppercase. (File Manager displays filenames in lowercase.)

An exception to the rules above occurs when the NTFS directory name or filename contains space and fewer than eight characters. In this case, NTFS does not create an 8.3 filename. This may cause problems if you attempt to access the file or directory through a network. To work around this situation, substitute an illegal character, such as a "[", for the space and NTFS will create a legal 8.3 filename. Even though this behavior seems inconsistent, it maintains compatibility with MS-DOS. In MS-DOS, a space is considered an illegal character and causes similar problems when it is used in that environment.

The following examples demonstrate how NTFS applies these rules:

a file.doc

This is not converted because the filename has fewer than 8 characters and contains a space.


a[file.doc

This is converted to A_FILE~1.DOC because the filename contains illegal characters.


A Long Filename.TXT

This is converted to ALONGF~1.TXT because the filename contains more than 8 characters.



Additional query words: prodnt conversion convert file name lfn

Keywords: kbother KB101601