Command.com - The MS-DOS Command Interpreter

The first time you run MS-DOS, you are prompted to enter current date and time. After that prompt, you go on to the command prompt, possibly "C>". If the AUTOEXEC.BAT file is created, the date and time asking prompt doesn't show up any more. The following program written in pseudo code shows how COMMAND.COM starts.

If Switch("/p") Then
   If Exists("AUTOEXEC.BAT") Then
      Interpret "AUTOEXEC.BAT"
   Else
      Exec "DATE"
      Exec "TIME"
   End If
End If

Normally, COMMAND.COM starts with the /P switch. You can optionally replace COMMAND.COM with Norton Utilities NDOS.COM. In order to do this, you can place the following sentence in the CONFIG.SYS file:

SHELL=C:\NU\NDOS.COM /P

By default, the space for environment variables is 256. It is quite small. In order to make it larger, you can customize it in the CONFIG.SYS file using the following line. You can also learn more about environment variables.

SHELL=C:\DOS\COMMAND.COM /P /E:4096

The line above tells MS-DOS to use COMMAND.COM as the command interpreter, and sets the environment size to 4096 bytes.

COMMAND.COM has some other switches. It can be used to debug batch files. Use the /C and /Y switch to trace and debug batch programs. For example, "COMMAND.COM /C /Y QC.BAT". During the execution, the interpreter would ask you whether to execute a line of command or not.

Return to MS-DOS Internal Commands