COMMAND.COM

from Wikipedia, the free encyclopedia

The COMMAND.COM is the operating system shell of the operating systems MS-DOS and PC-DOS and its resultant Windows systems the Windows 9x series.

This COMMAND.COMwas introduced by Tim Paterson in 86-DOS , which was taken over by Microsoft. In addition to the Microsoft variant, there were or are equivalents in the MS-DOS-compatible operating systems, including, for example, FreeCOM from the open-source project FreeDOS, which has been further developed to this day, or the command line interpreter that the former Microsoft competitor Digital Research supplied with its DR DOS . There are also variants such as 4DOS , which are not part of an operating system, but replace the system's interpreter and offer extended functions.

Function and commands

Function of the interpreter

The function of those COMMAND.COMin MS-DOS and Compatibles is to provide the basic - and previously only contained in the operating system - interface to the user. COMMAND.COMinterprets the user's input and then executes commands or tries to invoke another program. Also of COMMAND.COMthe typical DOS will therefore prompt ( English prompt ) appears - usually the current directory path followed by a greater-than sign, and in the default text mode white on black.

Since this is COMMAND.COM not part of the kernel but is executed as a separate program, a DOS system could theoretically also be used without COMMAND.COMor equivalent; Without any input option or sufficient automation, this would not have any meaningful use. In some cases, newer DOS versions offered the option of choosing a configuration without a (standard) interpreter; for example, by specifying the option in the file processed by MSDOS.SYS(MS-DOS), IBMDOS.COM(PC DOS, DR-DOS), or IO.SYS( Windows 9x ) . Another variant to replace it is to simply give the alternative program this name - the system then executes the desired alternative without noticing the difference. Since the execution of an -file and an -file do not differ, it does not matter if the name of the other program originally had the file extension . CONFIG.SYSshellCOMMAND.COMCOMEXE.EXE

COMMAND.COMexecutes on its first call AUTOEXEC.BAT.

Structure of commands

A COMMAND.COMdistinction is made between internal and external commands for the commands available for . The commands contained in the command line interpreter are called internal commands ; External commands, on the other hand, are independent programs that consist of their own program files (executable .COMor .EXEfiles).

The COMMAND.COMMS-DOS 5.0, introduced in the summer of 1991, knows 29 internal commands.

There are also so-called batch processing files, also called batch files or batches, which contain a “batch” of commands to be processed one after the other - internal or external, as desired. Batch files can and are often called like a real program or instruction; but they are to be assigned to the scripts .

A command is invoked by entering the name of that command. As soon as the command input has been completed with the Enter key ( Enter or Return ), it searches COMMAND.COMfor a suitable internal command. If no internal command is found, a search is first made in the current directory for executable files that have the command entered as a file name. If no suitable program was found in this way, every folder in the “path” is searched through. The first program found, if found, is executed; otherwise, an error message is displayed and the command prompt reappears.

Commands can be called either individually or followed by so-called parameters (also known as arguments ) . These parameters are interpreted differently depending on the command or program and can define various options. For example, a parameter (sometimes called a switch) that almost every command in DOS knows and that usually returns a short What's This ? . In contrast to programs that can only be controlled using parameters, there are also programs that are called without parameters and then offer the user the necessary input options himself. This also includes the various graphical user interfaces that can be started from the DOS command line interface , for example Microsoft Windows 1.x to 4.x or the versions of GEM for DOS.

Under MS-DOS 6.22, the maximum length of a command in the command prompt is 127 characters.

Different use and future

Microsoft Windows

MS-DOS prompt

Under the now outdated DOS-based Windows versions , the COMMAND.COMDOS system required anyway (which is also included from Windows 95) is used to provide a command prompt in a "window" of the user interface. Although the underlying DOS operating system no longer has sole access to the hardware, all functions of the interpreter can still be used without restriction.

Microsoft called this command line interface MS-DOS input prompt at the time , but the term is still incorrectly a synonym for text-based input in Windows operating systems for many users.

cmd.exe

Windows NT and all successors up to the current Microsoft operating system Windows 10 use a new, more powerful and largely downwardly compatible command line interpreter called cmd.exe. It contains many of the COMMAND.COMfunctions missing in the original , which previously could only be provided by third-party programs cmd.exe. For example, simple calculations can be performed and certain characters can be removed from a variable . In addition, cmd.exewith the advancing development of Windows NT-based operating systems, the one COMMAND.COMfrom Microsoft (at least as a standard command line interpreter) had its final appearance in Windows ME . Unlike COMMAND.COMin MS-DOS and compatible is cmd.exeto command-line commands in the only required console provided by conhost.exe, receive and batch processing files execute.

In addition to the standard command line interpreter cmd.exe, Windows NT and its successors - if implemented on a 32-bit basis - also offer a more compatible replacement interpreter, which is also COMMAND.COMcalled. Although it fulfills the same function as that COMMAND.COMof MS-DOS and older Windows versions, it is a real Windows application. All 16-bit functions are only provided by COMMAND.COMand the virtual DOS environment ( Virtual DOS Machine , abbreviated VDM). The disadvantage is that the interpreter COMMAND.COMfrom Windows NT corresponds more closely to the interpreter from MS-DOS versions 5 and 6 than the one used in Windows 95, 98 and Me. This also means that some improvements are lost, for example the possible use of long file names with more than eight characters and file extensions with more than three characters.

FreeCOM

The FreeCOM command line interpreter is included in the FreeDOS operating system . FreeCOM and FreeDOS - in contrast to MS-DOS , DR-DOS and most other DOS operating systems and / or command line interpreters - are still being developed. Similarly cmd.exe, FreeCOM also offers some extensions to the MS-DOS interpreter, but is more geared towards compatibility. For example, batch processing files from MS-DOS are usually interpreted correctly by FreeCOM even without adjustments.

Web links

Wikibooks: Windows Batch Programming Information  - Learning and Teaching Materials

Individual evidence

... and comments:

  1. MS-DOS 5.0 Internal and External Commands ( Memento June 2, 2015 in the Internet Archive ); English
  2. ^ Microsoft takes five for the launch of MS-DOS 5.0 release. In: Computer Business Review. June 11, 1991, accessed July 18, 2019 .