Windows 98 Long File Names in DOS Modes Explained

Windows 98 handled Long File Names (LFN) in DOS modes by bridging legacy 8.3 file conventions with modern 255-character filenames through its Virtual FAT (VFAT) architecture. Depending on whether a user ran a virtual DOS session inside the graphical desktop or booted directly into pure real-mode MS-DOS 7.1, the operating system utilized different mechanisms—ranging from protected-mode API extensions to backward-compatible disk directory records—to display, preserve, and manipulate extended filenames.

The Underlying VFAT Architecture

The classic FAT12 and FAT16 file systems natively restricted filenames to an eight-character name and a three-character extension (the 8.3 format). To implement LFNs without breaking compatibility with older software, Windows 98 used VFAT to generate two representations for every file:

  1. A Short Filename (SFN) Alias: An auto-generated 8.3 name, typically created by taking the first six valid characters of the long name, appending a tilde and a numeric tail (such as DOCUME~1.DOC), and keeping the original extension.
  2. LFN Directory Entries: Hidden, dummy directory entries placed immediately before the standard 8.3 directory entry. These dummy records were flagged with an impossible combination of file attributes—Read-Only, Hidden, System, and Volume Label—which instructed legacy DOS disk utilities to safely ignore them. Each dummy entry held up to 13 UTF-16 characters of the full filename.

LFN Handling in a Windows DOS Prompt (Virtual 8086 Mode)

When running a DOS command prompt from within the Windows 98 GUI, the environment operated in Virtual 8086 mode under the control of 32-bit protected-mode drivers.

In this mode, full LFN support was seamlessly active:

  • VFAT.VXD Driver: The 32-bit protected-mode file system driver intercepted all file operations.
  • INT 21h Extensions: Windows provided an extended MS-DOS API (specifically Interrupt 21h, Function 71h). Any DOS program coded to recognize this API could create, rename, and read long file names directly.
  • Enhanced COMMAND.COM: The command interpreter displayed the long file name alongside the 8.3 alias when executing the DIR command. Commands like COPY, MOVE, and REN accepted quoted long names (e.g., copy "My Long File.txt" C:\Backup).

LFN Handling in Pure Real-Mode DOS

When booting directly to "Command prompt only" via the startup menu or choosing "Restart in MS-DOS mode," Windows 98 unloaded the protected-mode GUI and reverted to 16-bit real-mode MS-DOS 7.1.

In this environment, LFN functionality changed significantly:

  • Loss of the Protected-Mode Driver: Because VFAT.VXD was inactive, the standard OS layer could no longer dynamically translate LFN APIs for generic software.
  • Fallback to 8.3 Aliases: Standard legacy DOS software interacting with the file system saw only the generated 8.3 short aliases. If an older DOS program modified a file, it often stripped the associated LFN dummy directory records, causing the file to lose its long name when viewed back in Windows.
  • Updated Core Utilities: Microsoft updated the native MS-DOS 7.1 utilities (COMMAND.COM, COPY, XCOPY, SCANDISK, and DEFRAG) to be LFN-aware. These specific tools read the hidden directory records and avoided damaging LFN structures during maintenance operations, even though generic third-party real-mode DOS applications remained restricted to 8.3 filenames.