Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
COMMAND.COM
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=={{anchor|Prompt}}Internal commands== Internal commands are commands stored directly inside the COMMAND.COM binary. Thus, they are always available but can only be executed directly from the command interpreter. All commands are executed after the {{keypress|Enter}} key is pressed at the end of the line. COMMAND.COM is not case-sensitive, meaning commands can be typed in any mixture of upper and lower case. ; [[BREAK (DOS command)|BREAK]]: Controls the handling of program interruption with {{keypress|Ctrl|C}} or {{keypress|Ctrl|Break}}. ; [[CHCP (command)|CHCP]]: Displays or changes the current system [[code page]]. ; [[CHDIR|CHDIR, CD]]: Changes the current [[working directory]] or displays the current directory. ; [[CLS (DOS command)|CLS]]: Clears the screen. ; [[COPY (DOS command)|COPY]]: 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). ; [[CTTY (DOS command)|CTTY]]: Defines the device to use for input and output. ; [[DATE (command)|DATE]]: Display and set the date of the system. ; [[DEL (command)|DEL, ERASE]]: Deletes a file. When used on a directory, deletes all files inside the directory only. In comparison, the external command [[DELTREE]] deletes all subdirectories and files inside a directory as well as the directory itself. ; [[DIR (command)|DIR]]: Lists the files in the specified directory. ; [[ECHO (command)|ECHO]]: Toggles whether text is displayed ({{codett|ECHO ON}}) or not ({{codett|ECHO OFF}}). Also displays text on the screen ({{codett|ECHO text}}). ; [[EXIT (command)|EXIT]]: Exits from COMMAND.COM and returns to the program which launched it. ; [[LFNFOR]]: Enables or disables the return of [[long filename]]s by the FOR command. ([[Windows 9x]]).{{Citation needed|date=March 2024}} ; [[LOADHIGH|LOADHIGH, LH]]: Loads a program into [[Upper Memory Area|upper memory]] ({{codett|HILOAD}} in [[DR DOS]]). ; [[LOCK (DOS command)|LOCK]]: Enables external programs to perform low-level disk access to a volume. ([[MS-DOS 7.1]] and [[Windows 9x]] only){{Citation needed|date=March 2024}} ; [[MKDIR|MKDIR, MD]]: Creates a new directory. ; [[PATH (DOS command)|PATH]]: Displays or changes the value of the PATH [[environment variable]] which controls the places where COMMAND.COM will search for executable files. ; [[PROMPT (DOS command)|PROMPT]]: Displays or change the value of the PROMPT environment variable which controls the appearance of the prompt. ; [[REN (command)|RENAME, REN]]: Renames a file or directory. ; [[RMDIR|RMDIR, RD]]: Removes an empty directory. ; [[SET (DOS command)|SET]]: Sets the value of an [[environment variable]]; without arguments, shows all defined environment variables. ; [[TIME (command)|TIME]]: Display and set the time of the system. ; [[TRUENAME]]: Display the fully expanded physical name of a file, resolving [[ASSIGN (DOS command)|ASSIGN]], [[JOIN (DOS command)|JOIN]] and [[SUBST]] logical filesystem mappings.<ref name="Paul_1997_NWDOSTIP"/> ; [[TYPE (DOS command)|TYPE]]: Display the content of a file on the console. ; [[UNLOCK (DOS command)|UNLOCK]]: Disables low-level disk access. (MS-DOS 7.1 and [[Windows 9x]] only){{Citation needed|date=March 2024}} ; [[VER (command)|VER]]: Displays the version of the [[operating system]]. ; [[VERIFY (DOS command)|VERIFY]]: Enable or disable verification of writing for files. ; [[VOL (command)|VOL]]:Shows information about a volume. === Batch file commands === [[Control structure|Control structures]] are mostly used inside batch files, although they can also be used interactively.<ref name="Caldera_1998_USER_CH7" /><ref name="Paul_1997_NWDOSTIP" /> ; <nowiki>:</nowiki>''label'': Defines a target for GOTO. ; [[CALL (DOS command)|CALL]]: Executes another batch file and returns to the old one and continues. ; [[FOR (DOS command)|FOR]]: Iteration: repeats a command for each out of a specified set of files. ; [[GOTO]]: Moves execution to a specified label. Labels are specified at the beginning of a line, with a colon ({{codett|:likethis}}). ; [[IF (DOS command)|IF]]: Conditional statement, allows branching of the program execution. ; [[PAUSE (DOS command)|PAUSE]]: Halts execution of the program and displays a message asking the user to press [[any key]] to continue. ; [[REM (DOS command)|REM]]: [[comment (computer programming)|comment]]: any text following this command is ignored. ; [[SHIFT (DOS command)|SHIFT]]: Replaces each of the [[replacement parameter]]s with the subsequent one (e.g. {{codett|%0}} with {{codett|%1}}, {{codett|%1}} with {{codett|%2}}, etc.). ==== IF command ==== On exit, all external commands submit a [[return code]] (a value between 0 and 255) to the calling program. Most programs have a certain convention for their return codes (for instance, 0 for a successful execution).<ref name="Paul_1997_BATTIPS"/><ref name="FD_2003_Errorlevel"/><ref name="Paul_2003_Exitcodes"/><ref name="Allen_2005"/> If a program was invoked by COMMAND.COM, the internal IF command with its ERRORLEVEL conditional can be used to test on error conditions of the last invoked external program.{{Citation needed|date=March 2024}} Under COMMAND.COM, internal commands do not establish a new value.{{Citation needed|date=March 2024}}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)