Default command line for MS-DOS and Windows 9x From Wikipedia, the free encyclopedia
COMMAND.COM is the default command-line interpreter for MS-DOS, Windows 95, Windows 98 and Windows Me. In the case of DOS, it is the default user interface as well. It has an additional role as the usual first program run after boot (init process). As a shell, COMMAND.COM has two distinct modes of operation: interactive mode and batch mode. Internal commands are commands stored directly inside the COMMAND.COM binary; thus, they are always available, but can only be executed directly from the command interpreter.
Other names | MS-DOS Prompt, Windows Command Interpreter |
---|---|
Developer(s) | Seattle Computer Products, IBM, Microsoft, The Software Link, Datalight, Novell, Caldera |
Initial release | 1980 |
Written in | x86 assembly language[1] |
Operating system | |
Platform | 16-bit x86 |
Successor | cmd.exe |
Type | Command-line interpreter |
COMMAND.COM is the default command-line interpreter for MS-DOS, Windows 95, Windows 98 and Windows Me. In the case of DOS, it is the default user interface as well.[2] It has an additional role as the usual first program run after boot (init process), hence being responsible for setting up the system by running the AUTOEXEC.BAT configuration file, and being the ancestor of all processes.[citation needed]
COMMAND.COM's successor on OS/2 and Windows NT systems is cmd.exe, although COMMAND.COM is available in virtual DOS machines on IA-32 versions of those operating systems as well. The COMMAND.COM filename was also used by Disk Control Program [de] (DCP), an MS-DOS derivative by the former East German VEB Robotron.[3]
COMMAND.COM is a DOS program. Programs launched from COMMAND.COM are DOS programs that use the DOS API to communicate with the disk operating system. The compatible command processor under FreeDOS is sometimes also named FreeCom.
As a shell, COMMAND.COM has two distinct modes of operation. The first is interactive mode, in which the user types commands which are then executed immediately. The second is batch mode, which executes a predefined sequence of commands stored as a text file with the .BAT extension.
Internal commands are commands stored directly inside the COMMAND.COM binary. Thus, they are always available but can only be executed directly from the command interpreter.
All commands are executed after the ↵ Enter key is pressed at the end of the line. COMMAND.COM is not case-sensitive, meaning commands can be typed in any mixture of upper and lower case.
ECHO ON
) or not (ECHO OFF
). Also displays text on the screen (ECHO text
).HILOAD
in DR DOS).Control structures are mostly used inside batch files, although they can also be used interactively.[5][4]
:likethis
).%0
with %1
, %1
with %2
, etc.).On exit, all external commands submit a return code (a value between 0 and 255) to the calling program. Most programs have a certain convention for their return codes (for instance, 0 for a successful execution).[6][7][8][9]
If a program was invoked by COMMAND.COM, the internal IF command with its ERRORLEVEL conditional can be used to test on error conditions of the last invoked external program.[citation needed]
Under COMMAND.COM, internal commands do not establish a new value.[citation needed]
Batch files for COMMAND.COM can have four kinds of variables:
Because DOS is a single-tasking operating system, piping is achieved by running commands sequentially, redirecting to and from a temporary file.[citation needed] COMMAND.COM makes no provision for redirecting the standard error channel.[citation needed]
command < filename
command > filename
command >> filename
command1 | command2
command1 ¶ command2
&
separator for compatibility with the cmd syntax in OS/2 and the Windows NT family.[11] (cmd does not support the ¶ separator.)Generally, the command line length in interactive mode is limited to 126 characters.[12][13][14] In MS-DOS 6.22, the command line length in interactive mode is limited to 127 characters.[citation needed]
Seamless Wikipedia browsing. On steroids.