File Systems

File names on the Windows 2000 platform can be up to 255 characters, and can contain spaces, multiple periods, and special characters that are forbidden in MS-DOS file names. Windows 2000 makes it possible for other operating systems to access files with long names by automatically generating an MS-DOS-readable (8.3) name for each file. Files are accessible over a network by computers using MS-DOS and Windows 3. x , as well as by computers using Windows 95, Windows 98, Windows NT, and Windows 2000 operating systems.

By creating 8.3 file names, Windows 2000 also enables MS-DOS-based and Windows 3. x –based applications to recognize and load files that have LFNs. In addition, when an application saves a file on a computer running Windows 2000, both the 8.3 file name and LFN are retained.

If the long name of a file or folder contains spaces, surround the name with quotation marks. For example, if you have a program called Dump Disk Files that you want to run from the command line and you enter the name without quotation marks, it generates the error message Cannot find the program Dump or one of its components.

You must also use quotation marks around each set of LFNs referenced when a path typed at the command line includes spaces, as in the following example:

move c:\This month's reports\*.* c:\Last month's reports

Use wildcard characters such as the asterisk ( * ) and question mark ( ? ) carefully in conjunction with the del and copy commands. Windows 2000 searches both long and short file names for matches to the wildcard character combination you specify, which can cause additional files to be deleted or copied. It is always a good idea to run the dir command first on the files specified to be sure you are only affecting the files you intend to use.

In Windows 2000, both FAT and NTFS use the Unicode character set for their names, which contain several forbidden characters that MS-DOS cannot read. To generate a short MS-DOS-readable file name, Windows 2000 deletes all of these characters from the LFN and removes any spaces. Because an MS-DOS-readable file name can have only one period, Windows 2000 also removes all extra periods from the file name. Next, Windows 2000 truncates the file name, if necessary, to six characters and appends a tilde ( ~ ) and a number. For example, each non-duplicate file name is appended with ~1 . Duplicate file names end with ~2 , then ~3 , and so on. After the file names are truncated, the file name extensions are truncated to three or fewer characters. Finally, when displaying file names at the command line, Windows 2000 translates all characters in the file name and extension to uppercase.

note-icon

Note

You can permit extended characters by setting the value of HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\NtfsAllowExtendedCharacterIn8dot3Name to 1.

warning-icon

Warning

Do not use a registry editor to edit the registry directly unless you have no alternative. The registry editors bypass the standard safeguards provided by administrative tools. These safeguards prevent you from entering conflicting settings or settings that are likely to degrade performance or damage your system. Editing the registry directly can have serious, unexpected consequences that can prevent the system from starting and require that you reinstall Windows 2000. To configure or customize Windows 2000, use the programs in Control Panel or Microsoft Management Console (MMC) whenever possible.

When there are five or more files that can result in duplicate short file names, Windows 2000 uses a slightly different method for creating short file names. For the fifth and subsequent files, Windows 2000:

  • Uses only the first two letters of the LFN.

  • Generates the next four letters of the short file name by mathematically manipulating the remaining letters of the LFN.

  • Appends ~1 (or another number, if necessary, to avoid a duplicate file name) to the result.

This method substantially improves performance when Windows 2000 must create short file names for a large number of files with similar LFNs. Windows 2000 uses this method to create short names for files on both FAT and NTFS volumes.

Table 17.9 shows the short file names for files that were created by six tests.

Table 17.9 Short File Names Created by Windows 2000 – Example One

Long File Name

Short File Name

This is test 1.txt

THISIS~1.TXT

This is test 2.txt

THISIS~2.TXT

This is test 3.txt

THISIS~3.TXT

This is test 4.txt

THISIS~4.TXT

This is test 5.txt

TH0FF9~1.TXT

This is test 6.txt

THFEF5~1.TXT

If the LFNs in Table 17.9 are created in a different order, their short file names are different, as shown in Table 17.10.

Table 17.10 Short File Names Created by Windows 2000 – Example Two

Long File Name

Short File Name

This is test 2.txt

THISIS~1.TXT

This is test 3.txt

THISIS~2.TXT

This is test 1.txt

THISIS~3.TXT

This is test 4.txt

THISIS~4.TXT

This is test 5.txt

TH0FF9~1.TXT

This is test 6.txt

THFEF5~1.TXT

To see both the long and short file names for each file in the folder, at the command line, type:

dir /x