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
Environment variable
(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|DOS-ENV}}DOS === {{anchor|Pre-environment|System environment|Master environment|Local environment|Pre-environment variable|System environment variable|Master environment variable|Local environment variable}} Under DOS, the ''master environment'' is provided by the primary command processor, which inherits the ''pre-environment'' defined in <code>CONFIG.SYS</code> when first loaded. Its size can be configured through the <code>COMMAND /E:n</code> parameter between 160<ref name="4DOS_8.00_HELP"/><!-- DR-DOS COMMAND: 128, MDOS: 120 --> and 32767<ref name="4DOS_8.00_HELP"/><!-- DR-DOS COMMAND: 32751 --> bytes. ''Local environment'' segments inherited to child processes are typically reduced down to the size of the contents they hold. Some command-line processors (like [[4DOS]]) allow to define a minimum amount of free environment space that will be available when launching secondary shells.<ref name="4DOS_8.00_HELP"/> While the content of environment variables remains unchanged upon storage, their names (without the "<code>%</code>") are always converted to uppercase, with the exception of ''pre-environment variables'' defined via the <code>[[CONFIG.SYS]]</code> directive <code>[[SET (CONFIG.SYS directive)|SET]]</code> under [[DR DOS 6.0]] and higher<ref name="Paul_1997_NWDOSTIP"/><ref name="Paul_1997_4DOSTIP"/> (and only with <code>[[SWITCHES (CONFIG.SYS directive)|SWITCHES=/L]]</code> (for "allow lowercase names") under [[DR-DOS 7.02]] and higher).<ref name="4DOS_8.00_HELP"/><ref name="Paul_1997_OD-A3"/> In principle, [[MS-DOS 7.0]] and higher also supports lowercase variable names (<code>[[#windir|%windir%]]</code>), but provides no means for the user to define them.<!-- but WIN.COM can set %windir% --> Environment variable names containing lowercase letters are stored in the environment just like normal environment variables, but remain invisible to most DOS software, since they are written to expect uppercase variables only.<ref name="4DOS_8.00_HELP"/><ref name="Paul_1997_NWDOSTIP"/><ref name="Paul_1997_4DOSTIP"/> Some command processors<!-- such as 4DOS --> limit the maximum length of a variable name to 80 characters.<ref name="4DOS_8.00_HELP"/> While principally only limited by the size of the ''environment segment'', some DOS and 16-bit Windows programs<ref name="4DOS_8.00_HELP"/><ref group="nb" name="NB_ENVLEN128"/> do not expect the contents of environment variables to exceed 128 characters. DR-DOS <code>COMMAND.COM</code> supports environment variables up to 255<!-- not 256 -->, [[4DOS]] even up to 512 characters.<ref name="4DOS_8.00_HELP"/> Since <code>COMMAND.COM</code> can be configured (via <code>/L:128..1024</code>) to support command lines up to 1024 characters internally under MS-DOS 7.0 and higher, environment variables should be expected to contain at least 1024 characters as well. In some versions of DR-DOS, the environment passed to drivers, which often do not need their environment after installation, can be shrunken or [[relocation (computing)|relocated]] through <code>SETENV</code> or <code>[[INSTALL (CONFIG.SYS directive)|INSTALL[HIGH]]]</code>/<code>[[LOADHIGH]]</code> options <code>/Z</code> (zero environment), <code>/D[:[[load drive|loaddrive]]]</code> (substitute drive, e.g. <code>B:TSR.COM</code>) and <code>/E</code> (relocate environment above program) in order to minimize the driver's effectively resulting resident [[memory footprint]].<ref name="Paul_1997_SETENV"/><ref name="Paul_1997_OD-A3"/><ref name="Paul_1997_NWDOSTIP"/><ref name="Paul_2002_CTMOUSE"/><ref name="PTS-DOS_2000"/><ref name="Paul_2002_COM"/> In batch mode, non-existent environment variables are replaced by a zero-length string. {{anchor|Reserved environment variable}}''Standard environment variables''<!-- DR-DOS term --> or ''reserved environment variables'' include: ;{{anchor|%APPEND%}}<code>%APPEND%</code> (supported since DOS 3.3): This variable contains a semicolon-delimited list of directories in which to search for files. It is usually changed via the <code>[[APPEND (DOS command)|APPEND]] /E</code> command, which also ensures that the directory names are converted into uppercase. Some DOS software actually expects the names to be stored in uppercase and the length of the list not to exceed 121<ref name="4DOS_8.00_HELP"/> characters, therefore the variable is best not modified via the <code>[[SET (DOS command)|SET]]</code> command. [[Long filename]]s containing spaces or other special characters must not be quoted (<code>"</code>). ;{{anchor|%CONFIG%}}<code>%CONFIG%</code> (supported since [[MS-DOS 6.0]] and [[PC DOS 6.1]], also supported by [[Datalight ROM-DOS|ROM-DOS]]<ref name="Datalight_2005_ROM-DOS"/>): This variable holds the symbolic name of the currently chosen boot configuration. It is set by the [[DOS BIOS]] (<code>[[IO.SYS]]</code>, <code>[[IBMBIO.COM]]</code>, etc.) to the name defined by the corresponding <code>[[CONFIG.SYS]]</code> directive <code>[[MENUITEM (CONFIG.SYS directive)|MENUITEM]]</code> before launching the primary command processor. Its main purpose is to allow further special cases in <code>[[AUTOEXEC.BAT]]</code> and similar batchjobs depending on the selected option at boot time. This can be emulated under DR-DOS by utilizing the <code>CONFIG.SYS</code> directive <code>[[SET (CONFIG.SYS directive)|SET]]</code> like <code>SET CONFIG=1</code>. ;{{anchor|%CMDLINE%}}<code>%CMDLINE%</code> (introduced with [[4DOS]], also supported since [[MS-DOS 7.0]]): This variable contains the fully expanded text of the currently executing command line. It can be read by applications to detect the usage of and retrieve long command lines, since the traditional method to retrieve the command line arguments through the [[Program Segment Prefix|PSP]] (or related [[Application programming interface|API]] functions) is limited to 126 characters and is no longer available when [[File Control Block|FCB]]s get expanded or the default [[Disk Transfer Area|DTA]] is used. While 4DOS supports longer command lines, <code>COMMAND.COM</code> still only supports a maximum of 126 characters at the prompt by default (unless overridden with <code>/U:128..255</code> to specify the size of the command line buffer), but nevertheless internal command lines can become longer through f.e. variable expansion (depending on <code>/L:128..1024</code> to specify the size of the internal buffer). In addition to the command-line length byte in the PSP, the PSP command line is normally limited by [[ASCII 13|ASCII-13]], and command lines longer than 126 characters will typically be truncated by having an ASCII-13 inserted at position 127,<ref name="Paul_1997_4DOSTIP"/> but this cannot be relied upon in all scenarios.<ref name="Paul_1997_4DOSTIP"/><ref group="nb" name="NB_CMDLINE"/> The variable will be suppressed for external commands invoked with a preceding <code>@</code>-symbol like in <code>@XCOPY ...</code> for backward compatibility and in order to minimize the size of the environment when loading non-relocating [[terminate-and-stay-resident program]]s. Some beta versions of [[Windows Chicago]] used <code>%CMDLINE%</code> to store only the remainder of the command line excessing 126 characters instead of the complete command line.<ref name="Paul_1997_NWDOSTIP"/><ref name="Paul_1997_4DOSTIP"/> ;{{anchor|%COMSPEC%}}<code>[[COMSPEC|%COMSPEC%]]</code> (supported since DOS 2.0): This variable contains the full [[8.3 filename|8.3]] path to the [[command processor]], typically <code>C:\[[COMMAND.COM]]</code> or <code>C:\DOS\COMMAND.COM</code>. It must not contain [[long filenames]], but under DR-DOS it may contain [[FAT file password|file]] and [[FAT directory password|directory password]]s. It is set up by the primary command processor to point to itself (typically reflecting the settings of the <code>[[CONFIG.SYS]]</code> directive <code>[[SHELL (CONFIG.SYS directive)|SHELL]]</code>), so that the resident portion of the command processor can reload its transient portion from disk after the execution of larger programs. The value can be changed at runtime to reflect changes in the configuration, which would require the command processor to reload itself from other locations. The variable is also used when launching secondary shells. ;{{anchor|%COPYCMD%}}<code>%COPYCMD%</code> (supported since [[MS-DOS 6.2]] and [[PC DOS 6.3]], also supported by [[Datalight ROM-DOS|ROM-DOS]]<ref name="Datalight_2005_ROM-DOS"/>): Allows a user to specify the <code>/Y</code> switch (to assume "Yes" on queries) as the default for the <code>[[copy (command)|COPY]]</code>, <code>[[XCOPY]]</code>, and <code>[[move (command)|MOVE]]</code> commands. A default of <code>/Y</code> can be overridden by supplying the <code>/-Y</code> switch on the command line. The <code>/Y</code> switch instructs the command to replace existing files without prompting for confirmation. ;{{anchor|%DIRCMD%}}<code>%DIRCMD%</code> (supported since [[MS-DOS 5.0]] and [[IBM DOS 5.0|PC DOS 5.0]], also supported by [[Datalight ROM-DOS|ROM-DOS]]<ref name="Datalight_2005_ROM-DOS"/>): Allows a user to specify customized default parameters for the <code>[[dir (command)|DIR]]</code> command, including file specifications. Preset default switches can be overridden by providing the negative switch on the command line. For example, if <code>%DIRCMD%</code> contains the <code>/W</code> switch, then it can be overridden by using <code>DIR /-W</code> at the command line. This is similar to the environment variable <code>[[#%$DIR%|%$DIR%]]</code> under [[DOS Plus]]<ref name="Kotulla_1987_Environment"/> and a facility to define default switches for <code>DIR</code> through its <code>/C</code> or <code>/R</code> switches under [[DR-DOS]] <code>COMMAND.COM</code>.<ref name="Paul_1997_NWDOSTIP"/> <code>%DIRCMD%</code> is also supported by the external <code>SDIR.COM</code>/<code>DIR.COM</code> [[Stacker (disk compression)|Stacker]] commands under [[Novell DOS 7]] and higher.<ref name="Paul_1997_NWDOSTIP"/> ;{{anchor|%LANG%}}<code>%LANG%</code> (supported since [[MS-DOS 7.0]]): This variable is supported by some tools to switch the locale for messages in multilingual issues. ;{{anchor|%LANGSPEC%}}<code>%LANGSPEC%</code> (supported since [[MS-DOS 7.0]]): This variable is supported by some tools to switch the locale for messages in multilingual issues. ;{{anchor|%NO_SEP%}}<code>%NO_SEP%</code> (supported since [[PC DOS 6.3]] and [[DR-DOS 7.07]]): This variable controls the display of [[Decimal separator#Digit grouping|thousands-separator]]s in messages of various commands. Issued by default, they can be suppressed by specifying <code>SET NO_SEP=ON</code> or <code>SET NO_SEP=1</code> under PC DOS. DR-DOS additionally allows to override the system's thousands-separator displayed as in f.e. <code>SET NO_SEP=.</code>.<ref name="4DOS_8.00_HELP"/> ;{{anchor|%PATH%}}<code>[[PATH (environment variable)|%PATH%]]</code> (supported since DOS 2.0): This variable contains a semicolon-delimited list of directories in which the [[command interpreter]] will search for [[executable file]]s. Equivalent to the Unix <code>[[#$PATH|$PATH]]</code> variable (but some DOS and Windows applications also use the list to search for data files similar to <code>[[#$LD_LIBRARY_PATH|$LD_LIBRARY_PATH]]</code> on Unix-like systems). It is usually changed via the <code>[[PATH (DOS command)|PATH]]</code> (or <code>PATH /E</code> under [[MS-DOS 6.0]]) command, which also ensures that the directory names are converted into uppercase. Some DOS software actually expects the names to be stored in uppercase and the length of the list not to exceed 123<ref name="4DOS_8.00_HELP"/> characters,<ref group="nb" name="NB_ENVLEN128"/> therefore the variable should better not be modified via the <code>[[SET (DOS command)|SET]]</code> command.<ref name="4DOS_8.00_HELP"/> [[Long filename]]s containing spaces or other special characters must not be quoted (<code>"</code>). By default, the current directory is searched first, but some command-line processors like [[4DOS]] allow "<code>.</code>" (for "current directory") to be included in the list as well in order to override this search order; some DOS programs are incompatible with this extension.<ref name="4DOS_8.00_HELP"/> ;{{anchor|%PROMPT%}}<code>%PROMPT%</code> (supported since DOS 2.0): This variable contains a <code>$</code>-tokenized string defining the display of the [[prompt (computing)|prompt]]. It is usually changed via the <code>[[PROMPT (DOS command)|PROMPT]]</code> command. ;{{anchor|%TEMP%|%TMP%}}<code>%TEMP%</code> (and <code>%TMP%</code>): These variables contain the path to the directory where [[temporary file]]s should be stored. Operating system tools typically only use <code>%TEMP%</code>, whereas third-party programs also use <code>%TMP%</code>. Typically <code>%TEMP%</code> takes precedence over <code>%TMP%</code>. The [[DR-DOS]] family supports a number of additional ''standard environment variables''<!-- DR-DOS term --> including: ;{{anchor|%BETA%}}<code>%BETA%</code>: This variable contains an optional message displayed by some versions (including [[DR DOS 3.41]]<!-- not supported by DR DOS 3.31-3.40 -->) of <code>COMMAND.COM</code> at the startup of secondary shells.<ref name="Paul_2002_CLS"/> ;{{anchor|%DRDOSCFG%|%NWDOSCFG%|%OPENDOSCFG%}}<code>%DRDOSCFG%</code>/<code>%NWDOSCFG%</code>/<code>%OPENDOSCFG%</code>: This variable contains the directory<ref name="Caldera_1998_USER"/> (without trailing "<code>\</code>") where to search for <code>.INI</code> and <code>.CFG</code> configuration files (that is, DR-DOS application specific files like <code>TASKMGR.INI</code>, <code>TASKMAX.INI</code>, <code>[[VIEWMAX.INI]]</code>, <code>FASTBACK.CFG</code> etc., class specific files like <code>COLORS.INI</code>, or global files like <code>[[DRDOS.INI]]</code>, <code>[[NWDOS.INI]]</code>, <code>[[OPENDOS.INI]]</code>, or <code>[[DOS.INI]]</code>), as used by the <code>INSTALL</code> and <code>SETUP</code> commands and various DR-DOS programs like <code>DISKOPT</code>, <code>DOSBOOK</code>, <code>EDIT</code>, <code>FBX</code>, <code>FILELINK</code>, <code>LOCK</code>, <code>SECURITY.OVL</code>/<code>NWLOGIN.EXE</code>, <code>SERNO</code>, <code>TASKMAX</code>, <code>TASKMGR</code>, <code>[[VIEWMAX]]</code>, or <code>UNDELETE</code>.<ref name="Paul_1997_NWDOSTIP"/> It must not contain [[long filename]]s. ;{{anchor|%DRCOMSPEC%}}<code>%DRCOMSPEC%</code>: This variable optionally holds an alternative path to the command processor taking precedence over the path defined in the <code>%COMSPEC%</code> variable, optionally including [[FAT file password|file]] and [[FAT directory password|directory password]]s. Alternatively, it can hold a special value of "<code>ON</code>" or "<code>1</code>" in order to enforce the usage of the <code>%COMSPEC%</code> variable even in scenarios where the <code>%COMSPEC%</code> variable may point to the wrong command-line processor, for example, when running some versions of the DR-DOS <code>[[SYS (command)|SYS]]</code> command under a foreign operating system.<ref name="Paul_2017"/> ;{{anchor|%DRSYS%}}<code>%DRSYS%</code>: Setting this variable to "<code>ON</code>" or "<code>1</code>" will force some versions of the DR-DOS <code>[[SYS (command)|SYS]]</code> command to work under foreign operating systems instead of displaying a warning.<ref name="Paul_2017"/> ;{{anchor|%FBP_USER%|FBP_USER}}<code>%FBP_USER%</code>: Specifies the user name used by the [[FastBack]] command <code>[[FBX (DOS command)|FBX]]</code> and <code>{user}[[.FB]]</code> configuration files under [[Novell DOS 7]].<ref name="Paul_1997_NWDOSTIP"/> ;{{anchor|%HOMEDIR%}}<code>%HOMEDIR%</code>: This variable may contain the home directory under DR-DOS (including [[DR DOS 5.0]] and [[DR DOS 6.0|6.0]]).<ref name="Paul_1997_NWDOSTIP"/><ref name="Paul_2002_CLS"/> ;{{anchor|%INFO%}}<code>%INFO%</code>: In some versions of DR-DOS <code>COMMAND.COM</code> this variable defines the string displayed by the <code>$I</code> token of the <code>[[PROMPT (DOS command)|PROMPT]]</code> command.<ref name="Paul_2002_CLS"/> It can be used, for example, to inform the user how to exit secondary shells. ;{{anchor|%LOGINNAME%}}<code>%LOGINNAME%</code>: In some versions of DR-DOS <code>COMMAND.COM</code> this variable defines the user name displayed by the <code>$U</code> token of the <code>[[PROMPT (DOS command)|PROMPT]]</code> command, as set up by f.e. login scripts for [[Novell NetWare]].<ref name="4DOS_8.00_HELP"/><ref name="Paul_1997_NWDOSTIP"/><ref name="Paul_2002_CLS"/> See also the similarly named pseudo-variable <code>[[#%LOGIN_NAME%|%LOGIN_NAME%]]</code>. ;{{anchor|%MDOS_EXEC%}}<code>%MDOS_EXEC%</code>: This variable can take the values "<code>ON</code>" or "<code>OFF</code>" under [[Multiuser DOS]].<!-- f.e CCI Multiuser DOS 7.22 GOLD --> If enabled, the operating system permits applications to shell out to secondary shells with the [[DOS Program Area]] (DPA) freed in order to have maximum DOS memory available for secondary applications instead of running them in the same domain as under DOS.<ref name="CCI_1997_HELP"/><ref name="CCI_1997_PRINTDOC"/> ;{{anchor|%NOCHAR%}}<code>%NOCHAR%</code>: This variable can be used to define the character displayed by some commands in messages for "No" in <code>[Y,N]</code> queries, thereby overriding the current system default (typically "<code>N</code>" in English versions of DR-DOS). If it contains a string, only the first character, uppercased, will be taken. Some commands also support a command line parameter <code>/Y</code> to automatically assume "Yes" on queries, thereby suppressing such prompts. If, however, the parameter <code>/Y:yn</code> is used to specify the "Yes"/"No" characters (thereby overriding any <code>%NOCHAR%</code> setting), queries are not suppressed. See also the related <code>CONFIG.SYS</code> directive <code>[[NOCHAR (CONFIG.SYS directive)|NOCHAR]]</code> and the environment variable <code>[[#%YESCHAR%|%YESCHAR%]]</code>.<ref name="Paul_2017"/> ;{{anchor|%NOSOUND%}}<code>%NOSOUND%</code>: Setting this variable to "<code>ON</code>" or "<code>1</code>" will disable default beeps issued by some DR-DOS commands in certain situations such as to inform the user of the completion of some operation, that user interaction is required, or when a wrong key was pressed. Command line options to specifically enable certain beeps will override this setting. ;{{anchor|%OS%}}<code>%OS%</code>:This variable contains the name of the operating system in order to distinguish between different DOS-related operating systems of [[Digital Research]]-origin in batch jobs and applications.<ref name="Caldera_1998_USER"/> Known values include "<code>DOSPLUS</code>" ([[DOS Plus 1.2]] in DOS emulation), "<code>CPCDOS 4.1</code>" (DOS Plus 1.2 in [[CP/M]] emulation), "<code>DRDOS</code>" ([[DR DOS 3.31]]-[[DR DOS 6.0|6.0]], [[DR DOS Panther]], [[DR DOS StarTrek]], [[DR-DOS 7.02]]<ref name="Caldera_1998_USER"/>-[[DR-DOS 7.05|7.05]]), "<code>EZDOS</code>" ([[EZ-DOS 3.41]]), "<code>PALMDOS</code>" and "<code>NetWare PalmDOS</code>" ([[PalmDOS 1.0]]), "<code>NWDOS</code>" ([[Novell DOS 7]]), "<code>NWDOS7</code>" (Novell DOS 7 Beta<!-- BETA 1 (1993-04-26) -->), "<code>OPENDOS</code>" ([[Caldera OpenDOS 7.01]], [[Caldera DR-OpenDOS 7.02]]), "<code>CDOS</code>" ([[Concurrent DOS]], [[Concurrent DOS XM]]), "<code>CPCDOS</code>" ([[Concurrent PC DOS]]), "<code>CDOS386</code>" ([[Concurrent DOS 386]]), "<code>DRMDOS</code>" ([[DR Multiuser DOS]]), "<code>MDOS</code>" ([[CCI Multiuser DOS]]<!-- Gold/Plus/Light -->),<ref name="CCI_1997_HELP"/> "<code>IMSMDOS</code>" ([[IMS Multiuser DOS]]), "<code>REAL32</code>" ([[REAL/32]]).<ref name="Paul_1997_NWDOSTIP"/><ref name="Paul_2002_OS"/> MS-DOS <code>[[INTERSVR (DOS command)|INTERSVR]]</code> looks for a value of "<code>DRDOS</code>" as well.<ref name="Paul_2002_OS"/> See also the identically named environment variable <code>[[#OS|%OS%]]</code> later introduced in the [[Windows NT family]]. ;{{anchor|%PEXEC%}}<code>%PEXEC%</code>: In some versions of DR-DOS this variable defines the command executed by the <code>$X</code> token of the <code>[[PROMPT (DOS command)|PROMPT]]</code> command before <code>COMMAND.COM</code> displays the prompt after returning from external program execution.<ref name="Paul_1997_NWDOSTIP"/><ref name="Caldera_1998_USER"/> ;{{anchor|%SWITCHAR%}}<code>%SWITCHAR%</code>: This variable defines the [[SwitChar]] to be used for argument parsing by some DR-DOS commands. If defined, it overrides the system's current SwitChar setting. The only accepted characters are "<code>/</code>" (DOS style), "<code>-</code>" (Unix style) and "<code>[</code>" (CP/M style). See also the related <code>CONFIG.SYS</code> directive <code>[[SWITCHAR (CONFIG.SYS directive)|SWITCHAR]]</code> (to set the system's SwitChar setting) and the <code>[[#%/%|%/%]]</code> ''system information variable'' in some issues of DR-DOS <code>COMMAND.COM</code> (to retrieve the current setting for portable batchjobs). ;{{anchor|%TASKMGRWINDIR%}}<code>%TASKMGRWINDIR%</code>: This variable specifies the directory, where the [[Windows]] <code>[[SYSTEM.INI]]</code> to be used by the DR-DOS <code>TASKMGR</code> multitasker is located, overriding the default procedure to locate the file.<ref name="Paul_1997_NWDOSTIP"/> ;{{anchor|%VER%}}<code>%VER%</code>: This variable contains the version of the operating system in order to distinguish between different versions of DR-DOS in batch jobs and in the display of the <code>[[ver (command)|VER]]</code> command.<ref name="Caldera_1998_USER"/> It is also used for the <code>$V</code> token of the <code>[[PROMPT (DOS command)|PROMPT]]</code> command and affects the value returned by the ''system information variable'' <code>[[#%OS_VERSION%|%OS_VERSION%]]</code>. Known values include "<code>1.0</code>" ([[PalmDOS 1.0]]), "<code>1.2</code>" ([[DOS Plus 1.2]] in DOS emulation), "<code>2.0</code>" ([[Concurrent DOS 386 2.0]]), "<code>3.0</code>" ([[Concurrent DOS 386 3.0]]), "<code>3.31</code>" ([[DR DOS 3.31]]), "<code>3.32</code>" ([[DR DOS 3.32]]), "<code>3.33</code>" ([[DR DOS 3.33]]), "<code>3.34</code>" ([[DR DOS 3.34]]), "<code>3.35</code>" ([[DR DOS 3.35]]), "<code>3.40</code>" ([[DR DOS 3.40]]), "<code>3.41</code>" ([[DR DOS 3.41]], [[EZ-DOS 3.41]]), "<code>3.41T</code>" ([[DR DOS 3.41T]]), "<code>4.1</code>" ([[Concurrent PC DOS 4.1]]), "<code>5.0</code>" ([[DR DOS 5.0]], [[DR Multiuser DOS 5.0]]), "<code>5.1</code>" ([[Novell DR Multiuser DOS 5.1]]), "<code>6.0</code>" ([[DR Concurrent DOS XM 6.0]], [[DR DOS 6.0]]), "<code>6.2</code>" ([[DR Concurrent DOS XM 6.2]]), "<code>7</code>" ([[Novell DOS 7]], [[Caldera OpenDOS 7.01]], [[DR-DOS 7.02]]-[[DR-DOS 7.05|7.05]]), "<code>7.00</code>" ([[CCI Multiuser DOS 7.00]]), "<code>7.07</code>" ([[DR-DOS 7.07]]), "<code>7.1</code>" ([[IMS Multiuser DOS 7.1]]), "<code>7.21</code>" ([[CCI Multiuser DOS 7.21]]),<ref name="CCI_1997_HELP"/> "<code>7.22</code>" ([[CCI Multiuser DOS 7.22]]) etc.<ref name="Paul_1997_NWDOSTIP"/><ref name="Paul_2002_OS"/><ref name="CCI_1997_HELP"/> ;{{anchor|%YESCHAR%}}<code>%YESCHAR%</code>:This variable can be used to define the character displayed by some commands in messages for "Yes" in <code>[Y,N]</code> queries, thereby overriding the current system default (typically "<code>Y</code>" in English versions of DR-DOS). If it contains a string, only the first character, uppercased, will be taken. Some commands also support a command line parameter <code>/Y</code> to automatically assume "Yes" on queries, thereby suppressing such prompts. If, however, the parameter <code>/Y:y</code> is used to specify the "Yes" character (thereby overriding any <code>%YESCHAR%</code> setting), queries are not suppressed. See also the related <code>CONFIG.SYS</code> directive <code>[[YESCHAR (CONFIG.SYS directive)|YESCHAR]]</code> and the environment variable <code>[[#%NOCHAR%|%NOCHAR%]]</code>.<ref name="Paul_2017"/> ;{{anchor|%$CLS%}}<code>%$CLS%</code>: This variable defines the control sequence to be sent to the console driver to clear the screen when the <code>[[CLS (command)|CLS]]</code> command is issued, thereby overriding the internal default ("<code>β[2J</code>" under DR-DOS, "<code>βE</code>" under [[DOS Plus 1.2]] on Amstrad machines<ref name="Kotulla_1987_Environment"/> as well as under [[Concurrent DOS]], [[Multiuser DOS]], and [[REAL/32]] for [[VT52]] terminals, or "<code>β+</code>" under Multiuser DOS for [[ASCII]] terminals).<ref name="CCI_1997_HELP"/> If the variable is not defined and no <code>[[ANSI.SYS]]</code> console driver is detected, the DR-DOS <code>COMMAND.COM</code> will directly clear the screen via <code>INT 10h/AH=00h</code> [[PC BIOS|BIOS]] function, like MS-DOS/PC DOS <code>COMMAND.COM</code> does. A special <code>\nnn</code>-notation for [[octal number]]s is supported to allow the definition of special characters like ESC ([[ASCII 27|ASCII-27]] = "β" = 1Bh = 33o), as f.e. in <code>SET $CLS=\033[2J</code>. To send the backslash ("<code>\</code>") itself, it can be doubled "<code>\\</code>".<ref name="Paul_1997_NWDOSTIP"/><ref name="Paul_2002_CLS"/><ref name="CCI_1997_HELP"/> ;{{anchor|%$DIR%}}<code>%$DIR%</code>: Supported by [[DOS Plus]] accepting the values "L" (long) or "W" (wide) to change the default layout of directory listings with [[dir (command)|DIR]]. Can be overridden using the command line options <code>/L</code> or <code>/W</code>.<ref name="Paul_2002_CLS"/><ref name="Kotulla_1987_Environment"/> See also the similar environment variable <code>[[#%DIRCMD%|%DIRCMD%]]</code> and the <code>DIR</code> options <code>/C</code> and <code>/R</code> of the DR-DOS COMMAND.COM.<ref name="Paul_1997_NWDOSTIP"/> ;{{anchor|%$PAGE%}}<code>%$PAGE%</code>: Supported by [[DOS Plus]] accepting the values "<code>ON</code>" or "<code>OFF</code>" for pagination control. Setting this to "<code>ON</code>" has the same affect as adding <code>/P</code> to commands supporting it (like [[dir (command)|DIR]] or [[TYPE (DOS command)|TYPE]]).<ref name="Paul_2002_CLS"/><ref name="Kotulla_1987_Environment"/> ;{{anchor|%$LENGTH%}}<code>%$LENGTH%</code>: Used by [[DOS Plus]] to define the screen length of the console in lines. This is used to control in a portable way when the screen output should be temporarily halted until a key is pressed in conjunction with the <code>/P</code> option supported by various commands or with automatic pagnination.<ref name="Paul_2002_CLS"/><ref name="Kotulla_1987_Environment"/> See also the related environment variables <code>[[#%$WIDTH%|%$WIDTH%]]</code> and <code>[[#%DIRSIZE%|%DIRSIZE%]]</code> as well as the similar pseudo-variable <code>[[#%_ROWS%|%_ROWS%]]</code>. ;{{anchor|%$WIDTH%}}<code>%$WIDTH%</code>: Used by [[DOS Plus]] to define the screen width of the console in columns. This is used to control in a portable way the formatting of the screen output of commands like <code>[[dir (command)|DIR]] /W</code> or <code>[[TYPE (DOS command)|TYPE]] filename</code>.<ref name="Paul_2002_CLS"/><ref name="Kotulla_1987_Environment"/> See also the related environment variables <code>[[#%$LENGTH%|%$LENGTH%]]</code> and <code>[[#%DIRSIZE%|%DIRSIZE%]]</code> as well as the similar pseudo-variable <code>[[#%_COLUMNS%|%_COLUMNS%]]</code>. ;{{anchor|%$SLICE%}}<code>%$SLICE%</code>: Used by [[DOS Plus]] accepting a numerical value to control the foreground/background time slicing of multitasking programs.<ref name="Paul_2002_CLS"/><ref name="Kotulla_1987_Environment"/> See also the DOS Plus command <code>[[SLICE (DOS command)|SLICE]]</code>. ;{{anchor|%$ON%}}<code>%$ON%</code>: This variable can hold an optional control sequence to switch text highlighting, reversion or colorization on. It is used to emphasize or otherwise control the display of the file names in commands like <code>[[TYPE (DOS command)|TYPE]] wildcard</code>, for example <code>SET $ON=\033[1m</code> with [[ANSI.SYS]] loaded or <code>SET $ON=\016</code> for an IBM or [[ESC/P]] printer. For the special <code>\nnn</code> octal notation supported, see <code>[[#%$CLS%|%$CLS%]]</code>.<ref name="Paul_1997_NWDOSTIP"/><ref name="Kotulla_1987_Environment"/> While the variable is undefined by default under DOS Plus and DR-DOS, the [[Multiuser DOS]] default for an [[ASCII]] terminal equals <code>SET $ON=\033p</code>.<ref name="Paul_2002_CLS"/><ref name="CCI_1997_HELP"/> See also the related environment variable <code>[[#%$OFF%|%$OFF%]]</code>. ;{{anchor|%$OFF%}}<code>%$OFF%</code>: This variable can hold an optional control sequence to switch text highlighting, reversion or colorization off. It is used to return to the normal output after the display of file names in commands like <code>[[TYPE (DOS command)|TYPE]] wildcard</code>, for example <code>SET $OFF=\033[0m</code> with [[ANSI.SYS]] loaded or <code>SET $OFF=\024</code> for an IBM or [[ESC/P]] printer. For the special <code>\nnn</code> octal notation supported, see <code>[[#%$CLS%|%$CLS%]]</code>.<ref name="Paul_1997_NWDOSTIP"/><ref name="Kotulla_1987_Environment"/> While the variable is undefined by default under DOS Plus and DR-DOS, the [[Multiuser DOS]] default for an [[ASCII]] terminal equals <code>SET $OFF=\033q</code>.<ref name="Paul_2002_CLS"/><ref name="CCI_1997_HELP"/> See also the related environment variable <code>[[#%$ON%|%$ON%]]</code>. ;{{anchor|%$HEADER%}}<code>%$HEADER%</code>: This variable can hold an optional control sequence issued before the output of the file contents in commands like <code>[[TYPE (DOS command)|TYPE]]</code> under DR-DOS 7.02 and higher. It can be used for highlighting, pagination or formatting, f.e. when sending the output to a printer, i.e. <code>SET $HEADER=\017</code> for an IBM or [[ESC/P]] printer. For the special <code>\nnn</code> octal notation supported, see <code>[[#%$CLS%|%$CLS%]]</code>.<ref name="Paul_2002_CLS"/> See also the related environment variable <code>[[#%$FOOTER%|%$FOOTER%]]</code>. ;{{anchor|%$FOOTER%}}<code>%$FOOTER%</code>: This variable can hold an optional control sequence issued after the output of the file contents in commands like <code>[[TYPE (DOS command)|TYPE]]</code> under DR-DOS 7.02 and higher. It is used to return to the normal output format, i.e. <code>SET $FOOTER=\022\014</code> in the printer example above. For the special <code>\nnn</code> octal notation supported, see <code>[[#%$CLS%|%$CLS%]]</code>.<ref name="Paul_2002_CLS"/> See also the related environment variable <code>[[#%$HEADER%|%$HEADER%]]</code>. [[Datalight ROM-DOS]] supports a number of additional ''standard environment variables'' as well including: ;{{anchor|%DIRSIZE%}}<code>%DIRSIZE%</code>: This variable is used to define non-standard screen sizes <code>rows[,cols]</code> for <code>[[DIR (DOS command)|DIR]]</code> options <code>/P</code> and <code>/W</code> (similar to <code>[[#%$LENGTH%|%$LENGTH%]]</code> and <code>[[#%$WIDTH%|%$WIDTH%]]</code> under DOS Plus).<ref name="Datalight_2005_ROM-DOS"/> ;{{anchor|%NEWFILE%}}<code>%NEWFILE%</code>: This variable is automatically set to the first parameter given to the CONFIG.SYS directive [[NEWFILE (CONFIG.SYS directive)|NEWFILE]].<ref name="Datalight_2005_ROM-DOS"/> {{anchor|%TZ%|%COMM%|%SOCKETS%|%HTTP_DIR%|%HOSTNAME%|%FTPDIR%}}<code>%TZ%</code>, <code>%COMM%</code>, <code>%SOCKETS%</code>, <code>%HTTP_DIR%</code>, <code>%HOSTNAME%</code> and <code>%FTPDIR%</code> are also used by ROM-DOS.<ref name="Datalight_2005_ROM-DOS"/>
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)