Skip to content
FreeDOSHow-To Published Updated 4 min readViews unavailable

How to Set Up Long Filename Support on FreeDOS with DOSLFN

Installing DOSLFN, understanding what it can and can't do, and verifying long filenames actually work with your specific FreeDOS utilities.

By default, FreeDOS operates under the classic 8.3 filename limit — DOSLFN adds support for the longer, VFAT-style filenames modern users expect, intercepting standard DOS file calls to translate between the two.

Step 1: confirm your FreeDOS installation includes DOSLFN

DIR C:\FREEDOS\BIN\DOSLFN.*

DOSLFN ships as part of the standard FreeDOS distribution — if it’s missing, it’s available from the FreeDOS package repository via FDIMPLES or the package manager covered elsewhere on this blog.

Step 2: add DOSLFN to CONFIG.SYS

DEVICE=C:\FREEDOS\BIN\DOSLFN.COM

Load it as early as practical in CONFIG.SYS, so subsequent drivers and programs started from AUTOEXEC.BAT all see long-filename support already active.

Step 3: reboot and verify it loaded

LOADED /C:DOSLFN

Step 4: create a file with a long name to test

COPY CON "My Long Document Name.txt"
This is a test.
^Z
DIR

Confirm the file appears with its full long name in DIR output, not truncated to an 8.3 equivalent.

Step 5: check the short-name alias DOSLFN generates alongside it

DIR /X

Every long-named file gets an automatically generated 8.3 short-name alias — useful to know both names exist simultaneously, since some programs will only ever see the short one.

Step 6: verify long names work correctly from within your actual applications

Open, save, and rename a long-named file from whatever specific DOS applications you plan to use regularly — as covered in fixing DOSLFN long filename problems, not every program honors long names even with DOSLFN loaded, so confirming your actual workflow works is worth doing directly rather than assuming.

Step 7: use quotes around long filenames containing spaces at the command line

TYPE "My Long Document Name.txt"

Unlike some later DOS-like environments, spaces in filenames need explicit quoting for FreeDOS’s command interpreter to treat the whole name as one argument.

Step 8: be aware of long-name behavior across removable media

Long filenames created under DOSLFN persist correctly on FAT-formatted removable media (USB drives, if USBASPI is configured) the same way they do on a hard disk, since the long-name data lives in the FAT filesystem structure itself, not anything DOSLFN stores separately.

Why DOSLFN is a driver-level solution rather than a built-in kernel feature

FreeDOS’s kernel itself remains fundamentally 8.3-based, for maximum compatibility with the huge body of software written against that exact assumption over DOS’s history — DOSLFN adds long-name support as an optional, removable layer on top, rather than changing that foundational behavior system-wide. This is precisely why it’s an installable driver you choose to load, not a permanent, unconditional change to how FreeDOS handles filenames.

The actual trick behind how long names fit inside an unmodified FAT structure

Long filenames on FAT weren’t made possible by changing the FAT filesystem’s on-disk structure at all — they’re a clever compatibility hack Microsoft introduced with Windows 95’s VFAT driver, storing each long name across a chain of extra 32-byte directory entries (up to 13 characters each, up to 20 entries chained together for a 255-character maximum) placed immediately before the file’s ordinary 8.3 entry. Each of those extra entries is deliberately marked with the attribute combination “hidden, system, read-only, volume label” simultaneously — a combination no genuine file would ever use — specifically so that older, LFN-unaware DOS tools would see that odd combination and skip right past those entries, seeing only the ordinary short-name entry underneath. DOSLFN’s whole job is recognizing and correctly parsing this same VFAT convention on FreeDOS, which is why it works transparently on any FAT volume already formatted or written to in an LFN-aware way, without needing any filesystem conversion at all.

What happens to a long name on a system without DOSLFN loaded

Because the long-name entries hide behind that unusual attribute combination, a plain FreeDOS session with DOSLFN not loaded simply doesn’t see them and falls back to each file’s ordinary 8.3 short-name alias — the long name itself isn’t damaged or lost in this scenario, just invisible until a VFAT-aware tool reads the volume again. This is worth knowing specifically because it means moving a DOSLFN-formatted drive temporarily to a plain, non-LFN DOS session and back is generally safe, unlike genuinely writing to the volume with a tool that doesn’t understand the VFAT convention at all, which can corrupt the long-name entries.

Deciding whether every machine you use this drive on needs DOSLFN loaded

If a FAT volume with long filenames will ever be read by a plain, non-LFN-aware DOS session (a rescue boot, an older utility disk), plan for that in advance rather than discovering it mid-task — reading is safe and simply shows short names, but you’ll want to already know each file’s short-name alias (via DIR /X ahead of time) if you need to reference a specific file precisely while working from a session that can’t see its long name at all.

Related:

Sources:

Comments