Command.com
command.com is the name for MS-DOS's default shell (or command line interpreter). It also has an additional role, as the first program being ran after boot, hence being responsible for setting up the system as specified in the autoexec.bat and config.sys configuration files, and being the ancestor of all processes.
As a shell, command.com has two distinct modes of work. First is the interactive mode, in which the user types commands which are then executed in front of his eyes. The second is the batch mode, which executes a pre-defined sequence of commands written down at a text file, with the extension .bat. The original concepts for both functionalities is almost certainly derived from the Unix shells, although most programmers would find command.com less able than its counterparts. However, the batch file format allowed for built-in scripting inside MS-DOS, which was and still is a very useful feature.
Note that this section does not try to give a full overview to the syntax of command.com, but rather serve as an overview and a mnemonic for the most common and interesting features. Note that all commands are run only after the Enter key is pressed at the end of the line. command.com is case-insensitive, meaning commands can be typed in either case and are all equivalent (so dir, DIR and DiR will all work in the same way).
In accordance with command.com's main function as an operating system shell, it includes a number of built-in commands for working with files.
In order to run a program, simply type the name of its executable and then press "Enter" (it is not necessary to use the extension, e.g. nc.exe can be summoned simply as nc). In order to change the current working drive (see Drive letter assignment), type its letter followed by a colon (D:). Other filesystem commands include:
Batch files for command.com can be said to have 4 kinds of variables:
Table of contents
1 Syntax
2 Filesystem commands
Syntax
Filesystem commands Other commands
Note that all commands from the interactive mode can be used in batch files; similarly, one can use batch-file commands directly on the command.com command line, interactively. Therefore, it is impossible to separate the syntax to "interactive" or "batch" commands.
Control structures
Control structures are mostly used inside batch files, although they can also be summoned interactively.
Variables
See also
External links