Administrative Considerations for Long Filenames

If you are supporting long filenames at a site with many users, the following issues must be considered:

Tip for Long Filenames in the Root Directory

Usually, it is best to store files in a directory beneath the root directory. This is especially true for files with long filenames. Files with long filenames use more directory entries than files with 8.3 filenames. Because the number of entries in the root is limited to 512, the root directory can fill up with fewer files if long filenames are used.

Notice that typing the command mkdir Examples creates a long filename directory entry that contains the name Examples to preserve the case, plus an 8.3 filename alias entry with the name EXAMPLES for compatibility. In this example, two directory entries are used.

Using the LFNBK Utility for Temporary Compatibility

Most hard disk utility programs released before Windows 95 require updating to work correctly with Windows 95. If you use a hard disk utility that was not created especially for use with Windows 95, you might lose long filenames and you are at risk of losing data. Examples of such programs include the following:

In special cases, you might need to run backup or disk management utilities created for older versions of Windows or MS-DOS that are not compatible with the extended file system capabilities of Windows 95. Or you might need occasionally to run an application that is not compatible with long filenames. In such cases, you can use the LFNBK utility to remove (and later restore) long filenames on a disk.

To install the LFNBK utility

Caution

The LFNBK utility is intended for use only by experienced Windows 95 users with special needs for compatibility with older disk utilities. It is not intended for everyday use by average users.

Microsoft recommends that users rely on the disk management utilities included with Windows 95 or use Windows 95-compatible utilities from other vendors, rather than attempting to use older utilities that are not compatible with Windows 95.

Notice also that the DriveSpace utility included with Windows 95 is compatible with long filenames and can be used without LFNBK to manage compressed disks created with older versions of DriveSpace or DoubleSpace.

The following shows the syntax for LFNBK:

lfnbk [/v] [/b | /r | /pe] [/nt] [/force] [/p] [drive]

The following table lists and describes the parameters for this command.

Parameter

Description

/v

Reports actions on the screen.

/b

Backs up and removes long filenames on the disk.

/r

Restores previously backed-up long filenames.

/pe

Extracts errors from backup database.

/nt

Does not restore backup dates and times.

/force

Forces LFNBK to run, even in unsafe conditions.

/p

Finds long filenames, but does not convert them to 8.3 filename aliases. This reports the existing long filenames, along with the associated dates for file creation, last access, and last modification of the file.


To preserve long filenames with disk utilities that do not recognize them

  1. Turn off tunneling.

    To do this, in the System option in Control Panel, click the Performance tab, and then click File System. In the File System Performance dialog box, click the Troubleshooting tab, and check the option named Disable Long Name Preservation for Old Programs.

  2. Close all other applications. LFNBK cannot rename open files.
  3. At the command prompt, type lfnbk /b [drive] to back up and remove long filenames.
  4. Restart the computer, and then run the disk utility. If it is an MS-DOS – based utility, run it in MS-DOS Mode. For a Windows-based utility, run it in the usual way.
  5. Turn tunneling on again, and then restart the computer.
  6. At the command prompt, type lfnbk /r [drive] to restore long filenames.

The LFNBK utility actually renames each file with a long filename to its associated alias. The filename changes are stored in the LFNBK.DAT file in the root of the drive where you are running LFNBK. This file is used to restore long filenames (when you run LFNBK with the /r switch).

The following list provides some brief notes for using the LFNBK utility:

Creating Long Filenames at the MS-DOS Prompt

At an MS-DOS prompt or when Windows 95 is started only at the command prompt (from the F8 Startup menu), the keyboard buffer's ability to create long filenames is limited to 127 characters. This is because the default command-line character limitation is 127 characters. In the default configuration, the MS-DOS environment will not allow more than 127 characters in a given command line. (However, in batch files, or for environment variables and other VM elements, the long filename support is 244 characters.)

You can increase the global command-line character limit for the keyboard buffer to its maximum by placing the following line in CONFIG.SYS:


shell=c:\windows\command.com /u:255

If the shell command is already present with the /u switch, increase the value to 255.

This command will affect all VMs and the Windows 95 command line.

With the command-line character limit set to its maximum of 255 characters, filenames are limited to 255 characters minus the contents of the command line. For example, the command line might contain the following:


copy con "long filename"

In this case, the maximum length of the long filename is 244 characters (255 minus the 11 characters of the command).

Note

It is necessary to put the filename in quotation marks on the command line only if the filename contains special characters such as spaces.

Notice, however, MS-DOS – based applications configured to run in MS-DOS Mode use only the real-mode FAT file system. Because of this, long filenames created in a Windows environment are not visible when the system runs in MS-DOS Mode; only the 8.3 filename aliases are visible.

The same is true of files with long filenames that are copied to a floppy disk subsequently used by a down-level FAT file system such as MS-DOS 6.0, Windows 3.1, OS/2 2.11, Windows NT 3.1, and so on.) On down-level file systems, only the 8.3 filename alias is visible on the floppy disk, even if it contains long filenames created in Windows 95.

Technical Notes on Long Filenames

This section summarizes some technical points with regard to long filenames. This information will be helpful to you if you experience problems with long filenames.

Long filenames cannot be used on SUBST drives.

Windows 95 supports SUBST only for backward compatibility with drives created on older systems. Filenames on SUBST drives must comply with the 8.3 filename rule.

Turning off numeric tails for filename aliases.

If you do not want to use filename aliases that automatically use a numeric tail (~n), you can force the file system to create friendly 8.3 filename aliases, at least for the first instance of the 8.3 filename.

To use friendly alias names instead of numeric tails

Turning off the extended file system features.

In extremely rare cases, you might determine that you need to turn off the extended file system features in Windows 95. In this case, you can enable the Windows 3.1 file system by changing the Registry. However, this is not a recommended option.

Using the older Windows 3.1 file system affects many of the features available under Windows 95. Also, the Windows 3.1 file system was not tested extensively under Windows 95 in the same way as the new file system. You can expect the following results if you enable the Windows 3.1 file system:

To enable the Windows 3.1 file system

  1. At the command prompt, run lfnbk /b to remove long filenames from the hard disk, as described in "Using the LFNBK Utility for Temporary Compatibility" earlier in this chapter.

    – Or –

    At the command prompt, run scandskw /o to remove long filenames and all extended file attributes from the disk. To remove long filenames from removable disks, include the drive letter with the command; for example, scandskw /o a:

    Caution If you use scandskw /o to remove long filenames, ScanDisk will check all fixed disks and will repair disk errors without warning you. Changes made with scandskw /o cannot be reversed.

  2. In Registry Editor, set the value of Win31FileSystem to 1 in the following Registry key. Then shut down and restart the computer.