Enable Extended Line Editing in MS-DOS 6.22
In MS-DOS 6.22, standard command-line editing is rudimentary,
requiring users to rely on function keys like F1 and F3 to recall
previous keystrokes. To enable modern, extended line editing—such as
using the arrow keys to navigate within a command, inserting text, and
toggling an interactive command history—MS-DOS relies on the
DOSKEY memory-resident utility. This article details how to
activate DOSKEY, configure it to run automatically at startup, and
utilize its extended editing capabilities.
Enabling DOSKEY
The extended editing functions in MS-DOS 6.22 are not toggled via
CONFIG.SYS directives; instead, they are provided by
DOSKEY.COM, a Terminate-and-Stay-Resident (TSR) program
located in the C:\DOS directory.
To activate extended line editing for the current session, type the following command at the prompt and press Enter:
DOSKEY
Once loaded, DOSKEY resides in memory and intercepts keyboard input at the command prompt to provide advanced editing and history features.
Automatic Configuration via AUTOEXEC.BAT
To ensure extended line editing is permanently enabled each time the
computer boots, add the command to your AUTOEXEC.BAT
file:
- Open the file in the MS-DOS Editor:
EDIT C:\AUTOEXEC.BAT - Add the following line to the file:
C:\DOS\DOSKEY.EXE - Save the changes and exit the editor.
Optional Buffer Configuration
DOSKEY reserves a default buffer (usually 512 bytes) to store command
history and macros. You can customize the buffer size using the
/BUFSIZE switch. For example, to allocate 1024 bytes:
DOSKEY /BUFSIZE=1024
Extended Line Editing Key Functions
Once DOSKEY is active, standard keyboard controls become available on the MS-DOS command line:
- Left Arrow (\(\leftarrow\)) and Right Arrow (\(\rightarrow\)): Move the cursor back and forth through the current command without erasing characters.
- Ctrl + Left Arrow / Ctrl + Right Arrow: Move the cursor one full word to the left or right.
- Home: Jump the cursor directly to the beginning of the command line.
- End: Jump the cursor directly to the end of the command line.
- Insert: Toggle between Insert mode (which allows inserting characters without overwriting) and Overstrike mode (the default DOS behavior).
- Delete: Remove the character directly at the cursor position.
- Backspace: Remove the character to the left of the cursor.
- Escape (Esc): Clear the current command line entirely.
Command History Controls
DOSKEY also enhances productivity by storing previously executed commands:
- Up Arrow (\(\uparrow\)): Recall the previously executed command.
- Down Arrow (\(\downarrow\)): Move forward through the recalled command list.
- Page Up (PgUp): Jump to the oldest command in the current history buffer.
- Page Down (PgDn): Jump to the most recent command in the current history buffer.
- F7: Display an interactive numbered list of all commands currently stored in the buffer.
- F9: Prompt for a command number (as displayed in the F7 list) to instantly recall that specific command.