SoFunction
Updated on 2025-04-09

How to use long file names in DOS

Yesterday I saw on a forum on a website that someone asked if long file names can be used under pure DOS, and someone gave him the answer "Impossible". Of course his reply is very wrong, but many people do not know how to use long file names in pure DOS. Now, I will introduce the method of using long file names under DOS.

Both DOS and Windows are constantly developing. The first operating system that supports long file names was Windows NT 3.5, and then Windows 95 also adopted this technology. However, for some reasons, MS does not add the long filename function to pure DOS. However, Microsoft just does not provide an LFN (long filename) application interface (API) under pure DOS, and DOS itself supports long filenames. Many commands that come with DOS7 and many new DOS software that have appeared in recent years (such as the now popular DJGPP program, etc.) can directly operate the LFN as long as you find that the LFN interface already exists. Therefore, as long as an application can provide an LFN interface under pure DOS, long file names under pure DOS can be implemented.

To achieve this goal, many people have started to work hard. The first one to provide LFN API was LFNDOS, so it is the most famous. However, since it has stopped updating a long time ago, there are many bugs and long Chinese file names have not been supported. Fortunately, a Chinese person helped the author of LFNDOS write a sub-function that supports long Chinese file names, so its latest version 1.07 already supports Chinese LFN. LFNDOS has many disadvantages, such as slow speed, large memory consumption, and many problems, so it is not very practical. Therefore, someone decided to write another LFN interface driver, which is DOSLFN. DOSLFN was made by a German and is still under development. Compared with LFNDOS, its biggest advantage is that it is fast speed, small memory, and supports Unicode. Its latest version is 0.32o. With my help, its author has now fully supported Chinese long file names, including Chinese long file names for GB2312, Big5, and even GBK character sets. Due to its above advantages, it becomes a very powerful and practical LFN interface driver, which can be downloaded in the "Driver" of this site. Once a long file name interface is available, various internal commands, external commands, and PKUNZIP commands in MS-DOS will automatically use long file names, which is very convenient. Due to the practicality of the long file name function, the long file name function has been automatically called in the "MS-DOS 7.10 Full Installation Version", so that after DOS is installed, it will directly fully support Chinese and English long file names. Note that this is not possible in MS-DOS because it is too old to support long file names.

In addition to LFN's API driver, there are other software that provides LFN support, such as LFNDIR, which can display long file names as an enhancement tool for DIR. However, since LFNDIR is a very old software and does not support FAT32 partitions and CDs, it is not very practical. The most powerful, practical and famous is Odi's LFN tools (can be downloaded in the "File Tools" of this site). It contains a set of long file name tools, such as LDIR, LCD, LRD, LDEL, etc. It is very convenient and stable. It fully supports FAT12/16/32 and long file names on CDs. It can be regarded as a necessary tool for operating long file names under pure DOS. Another important thing is that although MS-DOS itself does not have LFN support, it does not mean that all DOSs are like this. ROM-DOS 7.10 supports long file names and FAT32 locally without any other programs. In short, DOS really supports long file names.

Some old disk tools (such as NDD 8.0, etc.) do not support long file names since they were launched, and if used, they may damage the long file names. However, the new DOS software launched in recent years almost all support long file names. Some of them can use long file names directly as mentioned above, while others "understand" the existence of long file names without causing damage. Therefore, it is best to use these new DOS tools when using them, so that you can live in harmony with the long file name.