DOCUMENT:Q101601  21-JUL-1993  [W_NT]
TITLE   :INF: Converting Filenames from NTFS to FAT (8.3) Convention
PRODUCT :Windows NT
PROD/VER:3.10
OPER/SYS:WINDOWS
KEYWORDS:


----------------------------------------------------------------------
The information in this article applies to:

  - Microsoft Windows NT operating system, version 3.1
  - Microsoft Windows NT Advanced Server, version 3.1
----------------------------------------------------------------------

The Windows NT filesystem (NTFS) support 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 file name.123.456.789.txt 
   converts to THISIS~1.TXT

   Example 2: This is a really long file name.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 a legal character, such as a "[",
for the space and NTFS creates a legal 8.3 filename. Even though this
behavior seems inconsistent, it maintains compatibility with MS-DOS.
In MS-DOS, a space is considered a legal 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
   legal characters.

A Long File Name.TXT

   This is converted to ALONGF~1.TXT because the filename contains
   more than 8 characters.
 
Additional reference words: 3.10 conversion convert name

=============================================================================

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS
PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND.  MICROSOFT DISCLAIMS
ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  IN NO
EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR
ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL,
CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF
MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.  SOME STATES DO NOT ALLOW THE EXCLUSION
OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES
SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1993.