Change File Associations in MS-DOS 6.22
Standard MS-DOS 6.22 does not feature a native command or syntax to
globally map file extensions to specific programs at the standard
command prompt. Unlike modern Windows environments that use commands
like ASSOC or FTYPE, the default MS-DOS
command interpreter (COMMAND.COM) strictly executes only
files with .COM, .EXE, and .BAT
extensions. To run a data file in its corresponding program, users must
pass the file as an argument or employ external tools, shell
alternatives, or graphical environments.
The Limitation of COMMAND.COM
In MS-DOS 6.22, typing the name of a document (such as
DOCUMENT.TXT) at the prompt results in the error:
Bad command or file name
The shell lacks a registry or lookup table for global associations, requiring the execution syntax:
PROGRAM.EXE FILENAME.EXT
For example, to open a text file in MS-DOS Editor, you must explicitly type:
EDIT DOCUMENT.TXT
Methods to Simulate File Associations
While MS-DOS 6.22 does not offer a global association syntax natively, users historically relied on three primary workarounds to achieve this behavior:
1. MS-DOS Shell (DOSSHELL)
MS-DOS Shell, included on the MS-DOS 6.22 Supplemental Disk, provides a menu-driven interface that supports file associations.
To configure mappings in DOSSHELL:
- Highlight a file with the target extension.
- Select File from the menu bar, then choose Associate....
- Enter the executable name (e.g.,
C:\DOS\EDIT.COM) to map that extension.
This configuration is stored in DOSSHELL.INI, but it
only functions within the DOSSHELL graphical interface, not at the bare
command prompt.
2. Third-Party Shells (4DOS)
The most common way to enable global extension mappings directly at
the DOS command prompt was replacing COMMAND.COM with a
third-party command processor like 4DOS.
4DOS introduces "Executable Extensions" using the following environment variable syntax:
SET .EXT=PROGRAM.EXE
For example:
SET .TXT=C:\DOS\EDIT.COM
SET .DOC=C:\WORD\WORD.EXE
Once defined in AUTOEXEC.BAT, simply typing
NOTES.TXT at the prompt automatically launches
EDIT.COM NOTES.TXT.
3. Windows 3.1x WIN.INI Mappings
When running Windows 3.1 or 3.11 on top of MS-DOS 6.22, global
associations can be defined in the WIN.INI file under the
[Extensions] section:
[Extensions]
txt=notepad.exe ^.txt
doc=winword.exe ^.docThis mapping functions across File Manager and the Windows environment, though it does not carry over to raw MS-DOS sessions.