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!
=== 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)