COMMAND.COM explained

COMMAND.COM should not be confused with cmd.exe.

Other Names:MS-DOS Prompt,
Windows Command Interpreter
Developer:Seattle Computer Products, IBM, Microsoft, The Software Link, Datalight, Novell, Caldera
Programming Language:x86 assembly language
Platform:16-bit x86
Genre:Command-line interpreter

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, has two distinct modes of operation: interactive mode and batch mode. Internal commands are commands stored directly inside the binary; thus, they are always available, but can only be executed directly from the command interpreter.

Description

's successor on OS/2 and Windows NT systems is, although it is available in virtual DOS machines on IA-32 versions of those operating systems as well. The filename was also used by (DCP), an MS-DOS derivative by the former East German VEB Robotron.

is a DOS program. Programs launched from it are DOS programs that use the DOS API to communicate with the disk operating system. The compatible command processor under FreeDOS is sometimes also called FreeCom.

Operating modes

As a shell, 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

Internal commands are commands stored directly inside the binary. Thus, they are always available but can only be executed directly from the command interpreter.

All commands are executed after the key is pressed at the end of the line. is not case-sensitive, meaning commands can be typed in any mixture of upper and lower case.

: Controls the handling of program interruption with or .
  • : Displays or changes the current system code page.
  • , : Changes the current working directory or displays the current directory.
  • : Clears the screen.
  • : Copies one file to another (if the destination file already exists, MS-DOS asks whether to replace it). (See also XCOPY, an external command that could also copy directory trees).
  • : Defines the device to use for input and output.
  • : Display and set the date of the system.
  • , : Deletes a file. When used on a directory, deletes all files inside the directory only. In comparison, the external command deletes all subdirectories and files inside a directory as well as the directory itself.
  • : Lists the files in the specified directory.
  • : Toggles whether the commands executed by a batch file are displayed on screen or not . Also displays text on the screen .
  • : Exits from and returns to the program which launched it.
  • : Enables or disables the return of long filenames by the command. (Windows 9x).
  • , : Loads a program into upper memory (in DR DOS).
  • : Enables external programs to perform low-level disk access to a volume. (MS-DOS 7.1 and Windows 9x only)
  • , : Creates a new directory.
  • : Displays or changes the value of the environment variable which controls the places where will search for executable files.
  • : Displays or change the value of the environment variable which controls the appearance of the prompt.
  • , : Renames a file or directory.
  • , : Removes an empty directory.
  • : Sets the value of an environment variable; without arguments, shows all defined environment variables.
  • : Display and set the time of the system.
  • : Display the fully expanded physical name of a file, resolving, and SUBST logical filesystem mappings.
  • : Display the content of a file on the console.
  • : Disables low-level disk access. (MS-DOS 7.1 and Windows 9x only)
  • : Displays the version of the operating system.
  • : Enable or disable verification of writing for files.
  • : Shows information about a volume.
  • Batch file commands

    Control structures are mostly used inside batch files, although they can also be used interactively.