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!
==Variables== Batch files for COMMAND.COM can have four kinds of variables: * [[Environment variable]]s: These have the {{mono|%VARIABLE%}} form and are associated with values with the SET statement. Before DOS 3 COMMAND.COM will only expand environment variables in batch mode; that is, not interactively at the command prompt.{{citation needed|date=August 2017}} * [[Replacement parameter]]s: These have the form {{mono|%0}}, {{mono|%1}}...{{mono|%9}}, and initially contain the command name and the first nine [[command-line parameter]]s passed to the script (e.g., if the invoking command was {{kbd|myscript.bat John Doe}}, then {{mono|%0}} is "myscript.bat", {{mono|%1}} is "John" and {{mono|%2}} is "Doe"). The parameters to the right of the ninth can be mapped into range by using the SHIFT statement.{{Citation needed|date=March 2024}} * Loop variables: Used in loops, they have the {{mono|%%a}} format when run in batch files. These variables are defined solely within a specific FOR statement, and iterate over a certain set of values defined in that FOR statement.{{Citation needed|date=March 2024}} * Under [[Novell DOS 7]]<!-- 1993 -->, [[OpenDOS 7.01]], [[DR-DOS 7.02]] and higher, COMMAND.COM also supports a number of [[system information variable]]s,<ref name="Caldera_1998_USER_CH7"/><ref name="Caldera_1998_USER"/><ref name="Paul_1997_NWDOSTIP"/> a feature earlier found in [[4DOS 3.00]]<!-- 1990 --> and higher<ref name="4DOS_8.00_HELP"/> as well as in [[Multiuser DOS]],<!-- 1991 --><ref name="Paul_1997_NWDOSTIP"/><!-- not in CDOS 386 1.0 (1987), not sure about CDOS 386 3.0 (1989) --> although most of the supported variable names differ.
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)