Jump to content

COMMAND.COM

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Uriyan (talk | contribs) at 12:28, 13 August 2002 (Pre-alpha version, _under construction_). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

The MS-DOS operating system's default 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. Although not very useful by modern standards, the batch file format allowed for built-in scripting inside the MS-DOS, which was often a very useful feature.

Batch files use the following commands (the first two are often used during interactive work with command.com):

ECHO
This command allows text to be displayed.
SORT
This sorts the output of another command into a file or the like.
PAUSE
Halts execution of the program and displays a message asking the user to press any key to continue.
FOR
Iteration: repeats a command for each out of a specified set of files.
SHIFT
Replaces each of the 10 variables with the consequent one (e.g. %0←%1, %1←%2 etc.).
REM
Comment: any text following this command is ignored
IF
Conditional statement, allows to branch the program execution
CHOICE
Presents the user with a menu (MS-DOS 6 and higher).
GOTO
Moves execution to a specified label.