Draft for Information Only
Content
MS DOS Command: COMMAND.COM
MS DOS Command: COMMAND.COMReference from Microsoft MS-DOS cmd help DescriptionStarts a new instance of the MS-DOS command interpreter. A command interpreter is a program that lets you type commands. Use the EXIT command to stop the new command interpreter and return control to the old one. SyntaxCOMMAND [[drive:]path] [device] [/E:nnnnn] [/Y [/C command|/K command]] In your CONFIG.SYS file, use the following syntax: SHELL=[[dos-drive:]dos-path]COMMAND.COM [[drive:]path][device] [/E:nnnn] [/P [/MSG]] Parameters
Switches
Related CommandThe SHELL command is the preferred method of using COMMAND to permanently increase space for the environment table. RemarksLimits on environment sizeIf nnnnn is less than 160 or greater than 32768, MS-DOS uses the default value of 256 bytes and displays the following message: Parameter value not in allowed range. Changing your terminal deviceYou can specify a different device (such as AUX) for input and output by using the device parameter. For more information about device, see the CTTY command. Running multiple command interpretersWhen you start a new command interpreter, MS-DOS creates a new command environment. This new environment is a copy of the parent environment. You can change the new environment without affecting the old one. The default size of the new environment is 256 bytes or the size of the current environment rounded up to the next 16 bytes, whichever is larger. Use the /E switch to override the default size. (Note that the current environment refers to the memory actually being used, not to the environment size specified with the previous /E switch.) Transient and resident memoryMS-DOS loads the command interpreter in two parts: the resident part (which is always in memory) and the transient part (at the top of conventional memory). Some programs write over the transient part of COMMAND.COM when they run. When this happens, the resident part must locate the COMMAND.COM file on disk to reload the transient part. The COMSPEC environment variable identifies where COMMAND.COM is located on the disk. If COMSPEC is set to a floppy disk drive, MS-DOS might prompt you to insert a disk that contains COMMAND.COM. If MS-DOS is loaded in the HMA, a portion of resident COMMAND.COM is also loaded into the HMA, making more conventional memory available for programs. Using the /MSG switchUsually, MS-DOS leaves many error messages in the COMMAND.COM file on the disk instead of using memory to store them. When MS-DOS needs to display one of these messages, MS-DOS retrieves the message from the disk containing COMMAND.COM. If you are running MS-DOS from floppy disks instead of from a hard disk, MS-DOS cannot retrieve such error messages unless you have the disk containing COMMAND.COM in drive A. If this disk is not present, MS-DOS displays one of the following short messages instead of the full message: Parse error Extended errorYou can make sure MS-DOS displays complete error messages by using the /MSG switch with COMMAND. This switch forces MS-DOS to keep these error messages in memory so that they are always available when needed. Use the /MSG switch with COMMAND if you have a floppy disk system, unless you cannot afford to lose the memory used to store the error messages. You must also specify the /P switch when you use the /MSG switch. Internal commandsCOMMAND is called a command processor because it reads any commands that you type and processes them. Some commands are recognized and carried out by COMMAND itself. These commands are considered internal to COMMAND. Other MS-DOS commands are separate programs located on your hard disk, which MS-DOS loads just like your other programs. The following MS-DOS commands are implemented by COMMAND:
ExamplesThe following command specifies that the MS-DOS command interpreter is to start a new command interpreter from the current program, run a batch program named MYBAT.BAT, and then return to the first command interpreter: command /c mybat.bat The following CONFIG.SYS command specifies that COMMAND.COM is located in the DOS directory on drive C: shell=c:\dos\command.com c:\dos\ /e:1024 This command directs MS-DOS to set the COMSPEC environment variable to C:\DOS\COMMAND.COM. This command also creates an environment of 1024 bytes for this command interpreter. The following command starts an instance of COMMAND.COM and runs the MYBATCH.BAT file, stepping through the file command by command: command /y /c mybatch.bat ©sideway ID: 110700143 Last Updated: 7/22/2011 Revision: 0 Latest Updated Links
![]() ![]() ![]() ![]() ![]() |
![]() Home 5 Business Management HBR 3 Information Recreation Hobbies 8 Culture Chinese 1097 English 339 Travel 18 Reference 79 Computer Hardware 254 Software Application 213 Digitization 37 Latex 52 Manim 205 KB 1 Numeric 19 Programming Web 289 Unicode 504 HTML 66 CSS 65 SVG 46 ASP.NET 270 OS 431 DeskTop 7 Python 72 Knowledge Mathematics Formulas 8 Set 1 Logic 1 Algebra 84 Number Theory 206 Trigonometry 31 Geometry 34 Calculus 67 Engineering Tables 8 Mechanical Rigid Bodies Statics 92 Dynamics 37 Fluid 5 Control Acoustics 19 Natural Sciences Matter 1 Electric 27 Biology 1 |
Copyright © 2000-2025 Sideway . All rights reserved Disclaimers last modified on 06 September 2019