Environment variables

An environment variable is a  that can affect the way running  will behave on a computer.

They are part of the environment in which a process runs. For example, a running process can query the value of the TEMP environment variable to discover a suitable location to store s, or the HOME or USERPROFILE variable to find the owned by the user running the process.

They were introduced in their modern form in 1979 with, so are included in all  flavors and variants from that point onward including  and. From in 1982, all succeeding Microsoft operating systems including, and  also have included them as a feature, although with somewhat different syntax, usage and standard variable names.

Design
In all and  systems, each process has its own separate set of environment s.  By default, when a process is created, it inherits a duplicate environment of its parent process, except for explicit changes made by the parent when it creates the child. At the level, these changes must be done between running   and. Alternatively, from s such as, a user can change environment variables for a particular command invocation by indirectly invoking it via  or using the   notation. A running program can access the values of environment variables for configuration purposes.

s and batch files use environment variables to communicate data and preferences to es. They can also be used to store temporary values for reference later in a shell script. However, in Unix, other variables are usually used for this.

In Unix, an environment variable that is changed in a script or compiled program will only affect that process and possibly child processes. The parent process and any unrelated processes will not be affected. Similarly, changing or removing a variable's value inside a batch file will change the variable for the duration of  's existence.

In Unix, the environment variables are normally initialized during system startup by the system init scripts, and hence inherited by all other processes in the system. Users can, and often do, augment them in the profile script for the command shell they are using. In Microsoft Windows, each environment variable's default value is stored in the or set in the   file.

On, a program is given an environment chosen by its caller, but it runs with different authority from its caller. The will usually load code from locations specified by the environment variables   and   and run it with the process's authority. If a setuid program did this, it would be insecure, because its caller could get it to run arbitrary code and hence misuse its authority. For this reason, unsets these environment variables at startup in a setuid process. setuid programs usually unset unknown environment variables and check others or set them to reasonable values.

Syntax
The variables can be used both in scripts and on the. They are usually referenced by putting special symbols in front of or around the variable name. For instance, to display the user home directory, in most scripting environments, the user has to type:

In DOS, OS/2 and Windows command-line interpreters such as  and , the user has to type this:

In, the user has to type this:

The commands  ,  , and   display all environment variables and their values. can also be used to print a single variable by giving that variable name as the sole argument to the command.

Assignment
The commands  and   are also used to set environment variables and are often incorporated directly into the shell.

Unix
In Unix, the following commands can also be used, but are often dependent on a certain shell.

VARIABLE=value        # export VARIABLE       # for  and related shells

export VARIABLE=value # for, , and related shells

setenv VARIABLE value # for  and related shells

A few simple principles govern how environment variables achieve their effect.

Environment variables are local to the process in which they were set. If two shell processes are spawned and the value of an environment variable is changed in one, that change will not be seen by the other.

When a child process is created, it inherits all the environment variables and their values from the parent process. Usually, when a program calls another program, it first creates a child process by ing, then the child adjusts the environment as needed and lastly the child itself with the program to be called. This procedure gives the calling program control over the environment of the called program.

In Unix and Unix-like systems, the names of environment variables are case-sensitive.

In Unix shells, variables may be assigned without the   keyword. Variables defined in this way are displayed by the   command, but are not true environment variables, as they are stored only by the shell and not recognized by the kernel. The  command will not display them, and child processes do not inherit them.

VARIABLE=value

However, if used in front of a program to run, the variables will be added to the program's environment: VARIABLE=value program_name [arguments]

The persistence of an environment variable can be session-wide or system-wide.

unset is a builtin command implemented by both the family  (sh, ksh, bash, etc.) and the  family (csh, tcsh, etc.) of s. It unsets a shell variable, removing it from memory and the shell's exported environment. It is implemented as a, because it directly manipulates the internals of the shell. Read-only shell variables cannot be unset. If one tries to unset a read-only variable, the unset command will print an error message and return a non-zero exit code.

DOS, OS/2 and Windows
In DOS, OS/2 and Windows command-line interpreters such as  and , the   command is used to assign environment variables and values using the following arguments: SET VARIABLE=value

The   command without any arguments displays all environment variables along with their values.

Examples
Examples of environment variables include:


 * : a list of directory paths. When the types a command without providing the full path, this list is checked to see whether it contains a path that leads to the command.
 * and  (Microsoft Windows): indicate where a user's  is located in the.
 * and  (Microsoft Windows): for storing application settings. Many applications incorrectly use   for application settings in Windows:   should only be used in dialogs that allow user to choose between paths like  ; for programmatic purposes,   (for roaming application settings shared across multiple devices),   (for local application settings) or   (for application settings shared between multiple OS users) should be used.
 * : specifies the type of or  being used (e.g.,   or  ).
 * : specifies how the prompt is displayed in the and variants.
 * : used to indicate where a user's mail is to be found.
 * : location where processes can store temporary files.

Unix

 * : Contains a colon-separated list of directories that the shell searches for commands that do not contain a slash in their name (commands with slashes are interpreted as file names to execute, and the shell attempts to execute the files directly). It is equivalent to the, and    variable.


 * : Contains the location of the user's . Although the current user's home directory can also be found out through the C-functions  and ,   is often used for convenience in various shell scripts (and other contexts). Using the environment variable also gives the user the possibility to point to another directory.


 * : This variable points to the current directory. Equivalent to the output of the command pwd when called without arguments.


 * : Contains the identifier for the display that programs should use by default.


 * : On many Unix systems with a, contains a colon-separated list of directories that the dynamic linker should search for s when building a process image after , before searching in any other directories.


 * or : Alternatives to   typically used on older Unix versions.


 * :  is used to set to the default . For example, if the locale values are , then the language is set to (Brazilian) Portuguese and Brazilian practice is used where relevant. Different aspects of localization are controlled by individual  -variables ( ,  ,   etc.).   can be used to force the same locale for all aspects.


 * : Refers to . It can be in several formats, either specifying the timezone itself or referencing a file (in ).

DOS
Under DOS, the master environment is provided by the primary command processor, which inherits the pre-environment defined in  when first loaded. Its size can be configured through the  parameter between 160 and 32767 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 ) allow to define a minimum amount of free environment space that will be available when launching secondary shells. While the content of environment variables remains unchanged upon storage, their names (without the " ") are always converted to uppercase, with the exception of pre-environment variables defined via the  directive   under  and higher (and only with   (for "allow lowercase names") under  and higher). In principle, and higher also supports lowercase variable names, but provides no means for the user to define them. 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. Some command processors limit the maximum length of a variable name to 80 characters. While principally only limited by the size of the environment segment, some DOS and 16-bit Windows programs do not expect the contents of environment variables to exceed 128 characters. DR-DOS  supports environment variables up to 255,  even up to 512 characters. Since  can be configured (via  ) 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 relocated through  or  /  options   (zero environment),   (substitute drive, e.g.  ) and   (relocate environment above program) in order to minimize the driver's effectively resulting resident memory footprint.

In batch mode, non-existent environment variables are replaced by a zero-length string.

Standard environment variables or reserved environment variables include:


 * (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  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 characters, therefore the variable is best not modified via the   command. s containing spaces or other special characters must not be quoted.


 * (supported since and, also supported by ): This variable holds the symbolic name of the currently chosen boot configuration. It is set by the  ( ,  , etc.) to the name defined by the corresponding   directive   before launching the primary command processor. Its main purpose is to allow further special cases in   and similar batchjobs depending on the selected option at boot time. This can be emulated under DR-DOS by utilizing the   directive   like.


 * (introduced with, also supported since ): 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 (or related  functions) is limited to 126 characters and is no longer available when s get expanded or the default  is used. While 4DOS supports longer command lines,   still only supports a maximum of 126 characters at the prompt by default (unless overridden with   to specify the size of the command line buffer), but nevertheless internal command lines can become longer through f.e. variable expansion (depending on   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 , and command lines longer than 126 characters will typically be truncated by having an ASCII-13 inserted at position 127, but this cannot be relied upon in all scenarios. The variable will be suppressed for external commands invoked with a preceding  -symbol like in   for backward compatibility and in order to minimize the size of the environment when loading non-relocating s. Some beta versions of  used   to store only the remainder of the command line excessing 126 characters instead of the complete command line.


 * (supported since DOS 2.0): This variable contains the full path to the, typically   or  . It must not contain , but under DR-DOS it may contain file and directory passwords. It is set up by the primary command processor to point to itself (typically reflecting the settings of the   directive  ), 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.


 * (supported since and, also supported by ): Allows a user to specify the   switch (to assume "Yes" on queries) as the default for the  ,  , and   commands. A default of   can be overridden by supplying the   switch on the command line. The   switch instructs the command to replace existing files without prompting for confirmation.


 * (supported since and, also supported by ): Allows a user to specify customized default parameters for the   command, including file specifications. Preset default switches can be overridden by providing the negative switch on the command line. For example, if   contains the   switch, then it can be overridden by using   at the command line. This is similar to the environment variable   under  and a facility to define default switches for   through its   or   switches under   .   is also supported by the external  /   commands under  and higher.


 * (supported since ): This variable is supported by some tools to switch the locale for messages in multilingual issues.


 * (supported since ): This variable is supported by some tools to switch the locale for messages in multilingual issues.


 * (supported since and ): This variable controls the display of s in messages of various commands. Issued by default, they can be suppressed by specifying   or   under PC DOS. DR-DOS additionally allows to override the system's thousands-separator displayed as in f.e..


 * (supported since DOS 2.0): This variable contains a semicolon-delimited list of directories in which the will search for s. Equivalent to the Unix   variable (but some DOS and Windows applications also use the list to search for data files similar as   on Unix-like systems). It is usually changed via the   (or   under ) 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 characters, therefore the variable should better not be modified via the   command. s containing spaces or other special characters must not be quoted . By default, the current directory is searched first, but some command-line processors like  allow " " (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.


 * (supported since DOS 2.0): This variable contains a -tokenized string defining the display of the . It is usually changed via the   command.


 * (and ): These variables contain the path to the directory where s should be stored. Operating system tools typically only use , whereas third-party programs also use  . Typically   takes precedence over.

The family supports a number of additional standard environment variables including:


 * : This variable contains an optional message displayed by some versions (including ) of  at the startup of secondary shells.


 * / / : This variable contains the directory (without trailing " ") where to search for  and   configuration files (that is, DR-DOS application specific files like ,  ,  ,   etc., class specific files like  , or global files like  ,  ,  , or  ), as used by the   and   commands and various DR-DOS programs like  ,  ,  ,  ,  ,  ,  / ,  ,  ,  ,  , or  . It must not contain s.


 * : This variable optionally holds an alternative path to the command processor taking precedence over the path defined in the  variable, optionally including file and directory passwords. Alternatively, it can hold a special value of " " or " " in order to enforce the usage of the   variable even in scenarios where the   variable may point to the wrong command-line processor, for example, when running some versions of the DR-DOS   command under a foreign operating system.


 * : Setting this variable to " " or " " will force some versions of the DR-DOS  command to work under foreign operating systems instead of displaying a warning.


 * : Specifies the user name used by the command   and   configuration files under.


 * : This variable may contain the home directory under DR-DOS (including and ).


 * : In some versions of DR-DOS  this variable defines the string displayed by the   token of the   command. It can be used, for example, to inform the user how to exit secondary shells.


 * : In some versions of DR-DOS  this variable defines the user name displayed by the   token of the   command, as set up by f.e. login scripts for . See also the similarly named pseudo-variable.


 * : This variable can take the values " " or " " under . If enabled, the operating system permits applications to shell out to secondary shells with the (DPA) freed in order to have maximum DOS memory available for secondary applications instead of running them in the same domain as under DOS.


 * : This variable can be used to define the character displayed by some commands in messages for "No" in  queries, thereby overriding the current system default (typically " " 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   to automatically assume "Yes" on queries, thereby suppressing such prompts. If, however, the parameter   is used to specify the "Yes"/"No" characters (thereby overriding any   setting), queries are not suppressed. See also the related   directive   and the environment variable.


 * : Setting this variable to " " or " " 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.


 * :This variable contains the name of the operating system in order to distinguish between different DOS-related operating systems of -origin in batch jobs and applications. Known values include " " ( in DOS emulation), " " (DOS Plus 1.2 in emulation), " " (-,, , -), " " , " " and " " , " " , " " (Novell DOS 7 Beta), " " , " " , " " , " " , " " , " " , " " , " " . MS-DOS   looks for a value of " " as well. See also the identically named environment variable   later introduced in the.


 * : In some versions of DR-DOS this variable defines the command executed by the  token of the   command before   displays the prompt after returning from external program execution.


 * : This variable defines the 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 " " (DOS style), " " (Unix style) and " " (CP/M style). See also the related   directive   (to set the system's SwitChar setting) and the   system information variable in some issues of DR-DOS   (to retrieve the current setting for portable batchjobs).


 * : This variable specifies the directory, where the   to be used by the DR-DOS   multitasker is located, overriding the default procedure to locate the file.


 * : 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  command. It is also used for the   token of the   command and affects the value returned by the system information variable  . Known values include " ", " " ( in DOS emulation), " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " (, , -), " " , " " , " " , " " , " "  etc.


 * : This variable can be used to define the character displayed by some commands in messages for "Yes" in  queries, thereby overriding the current system default (typically " " 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   to automatically assume "Yes" on queries, thereby suppressing such prompts. If, however, the parameter   is used to specify the "Yes" character (thereby overriding any   setting), queries are not suppressed. See also the related    directive   and the environment variable.


 * : This variable defines the control sequence to be sent to the console driver to clear the screen when the  command is issued, thereby overriding the internal default (" " under DR-DOS, " " under  on Amstrad machines as well as under, , and  for  terminals, or " " under Multiuser DOS for  terminals). If the variable is not defined and no   console driver is detected, the DR-DOS   will directly clear the screen via    function, like MS-DOS/PC DOS   does. A special  -notation for s is supported to allow the definition of special characters like ESC ( = "←" = 1Bh = 33o), as f.e. in  . To send the backslash (" ") itself, it can be doubled " ".


 * : Supported by accepting the values "L" (long) or "W" (wide) to change the default layout of directory listings with . Can be overridden using the command line options   or  . See also the similar environment variable   and the   options   and   of the DR-DOS COMMAND.COM.


 * : Supported by accepting the values " " or " " for pagination control. Setting this to " " has the same affect as adding   to commands supporting it (like  or ).


 * : Used by 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   option supported by various commands or with automatic pagnination. See also the related environment variables   and   as well as the similar pseudo-variable.


 * : Used by 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   or  . See also the related environment variables   and   as well as the similar pseudo-variable.


 * : Used by accepting a numerical value to control the foreground/background time slicing of multitasking programs. See also the DOS Plus command.


 * : 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, for example   with  loaded or   for an IBM or  printer. For the special   octal notation supported, see  . While the variable is undefined by default under DOS Plus and DR-DOS, the  default for an  terminal equals  . See also the related environment variable.


 * : 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, for example   with  loaded or   for an IBM or  printer. For the special   octal notation supported, see  . While the variable is undefined by default under DOS Plus and DR-DOS, the  default for an  terminal equals  . See also the related environment variable.


 * : This variable can hold an optional control sequence issued before the output of the file contents in commands like  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.   for an IBM or  printer. For the special   octal notation supported, see  . See also the related environment variable.


 * : This variable can hold an optional control sequence issued after the output of the file contents in commands like  under DR-DOS 7.02 and higher. It is used to return to the normal output format, i.e.   in the printer example above. For the special   octal notation supported, see  . See also the related environment variable.

supports a number of additional standard environment variables as well including:


 * : This variable is used to define non-standard screen sizes rows[,cols] for  options /P and /W (similar to   and   under DOS Plus).


 * : This variable is automatically set to the first parameter given to the CONFIG.SYS directive.

,,  ,  ,   and   are also used by ROM-DOS.

OS/2

 * : Contains a semicolon-separated list of directories which are searched for s before the directories given by the  variable (which is set during system startup with the special  directive  ). It is possible to specify relative directories here, including " " for the current working directory. See also the related environment variable.


 * : a list of directories to be searched for s like, but searched after the list of directories in.

Windows
System path variables refer to locations of critical operating system resources, and as such generally are not user-dependent.


 * : Contains the full path to the  directory of the logged-in user. Does not work on Windows NT 4.0 SP6 UK.


 * : This variable is the temporary files of Applications. Its uses include storing of, , caching and profiles of web browsers.


 * / :The  variable contains the full path to the command processor; on the Windows NT family of operating systems, this is, while on ,   is.


 * :The  variable contains a symbolic name of the operating system family to distinguish between differing feature sets in s. It resembles an identically named environment variable   found in all DOS-related operating systems of -origin like Concurrent DOS, Multiuser DOS, REAL/32, DOS Plus, DR DOS, Novell DOS and OpenDOS.   always holds the string " " on the.


 * : This variable contains a semicolon-delimited (do not put spaces in between) list of directories in which the command interpreter will search for an executable file that matches the given command. Environment variables that represent paths may be nested within the  variable, but only at one level of indirection. If this sub-path environment variable itself contains an environment variable representing a path,   will not expand properly in the variable substitution. Equivalent to the    variable.


 * ,,  : The   variable points to the Program Files directory, which stores all the installed programs of Windows and others. The default on English-language systems is " ". In 64-bit editions of Windows (XP, 2003, Vista), there are also  , which defaults to " ", and  , which defaults to " ". The   itself depends on whether the process requesting the environment variable is itself 32-bit or 64-bit (this is caused by  redirection).


 * : This variable points to the Common Files directory. The default is " " in the English version of Windows.


 * : The  variable is a special system-wide environment variable found on Windows NT and its derivatives. Its value is the drive upon which the system directory was placed. The value of   is in most cases " ".


 * :The  variable is a special system-wide environment variable found on the Windows NT family of operating systems. Its value is the location of the system directory, including the drive and path. The drive is the same as   and the default path on a clean installation depends upon the version of the operating system. By default:
 * and newer versions use " ".
 * , and  use " ".
 * and uses " ".
 * uses " ".


 * :This variable points to the Windows directory. (On the Windows NT family of operating systems, it is identical to the  variable).,  and  are, by default, installed in " ". For other versions of Windows, see the   entry above.

User management variables store information related to resources and settings owned by various s within the system. As a general rule, these variables do not refer to critical system resources or locations that are necessary for the OS to run.


 * ( since Windows Vista): This variable expands to the full path to the All Users profile directory. This profile contains resources and settings that are used by all system accounts.  links copied to the All Users\' Start menu or Desktop directories will appear in every user's Start menu or , respectively.


 * : The name of the ' or ' to which the current user belongs. The related variable,, holds the  of the server that authenticated the current user's login credentials (name and password). For home PCs and PCs in a workgroup, the authenticating server is usually the PC itself. For PCs in a Windows domain, the authenticating server is a  (a primary domain controller, or PDC, in Windows NT 4-based domains).


 * : A special system-wide environment variable found on Windows NT and its derivatives. Its value is the location of the current user's profile directory, in which is found that user's HKCU registry hive . Users can also use the  variable to determine the active users login identification.

Optional System variables are not explicitly specified by default but can be used to modify the default behavior of certain built-in console commands. These variables also do not need to be explicitly specified as command line arguments.

Default values
The following tables shows typical default values of certain environment variables under English versions of Windows as they can be retrieved under.

(Some of these variables are also defined when running  under Windows, but differ in certain important details: Under , the names of environment variable are always uppercased. Some, but not all variables contain short  rather than s. While some variables present in the   environment are missing, there are also some variables specific to the   environment.)

In this list, there is no environment variable that refers to the location of the user's My Documents directory, so there is no standard method for setting a program's home directory to be the My Documents directory.

DOS
Besides true environment variables, which are statically stored in the environment until changed or deleted, a number of pseudo-environment variables exist for batch processing.

The so-called replacement parameters or replaceable parameters (Microsoft / IBM terminology) aka replacement variables (Digital Research / Novell / Caldera terminology) or s (JP Software terminology) .. and  can be used to retrieve the calling parameters of a batchjob, see. In batchjobs, they can be retrieved just like environment variables, but are not actually stored in the environment.

Some command-line processors (like ,   /  (Terminal Message Process), JP Software , , ,  and Windows ) support a type of pseudo-environment variables named system information variables (Novell / Caldera terminology) or internal variables (JP Software terminology), which can be used to retrieve various possibly dynamic, but read-only information about the running system in batch jobs. The returned values represent the status of the system in the moment these variables are queried; that is, reading them multiple times in a row may return different values even within the same command; querying them has no direct effect on the system. Since they are not stored in the environment, they are not listed by and do not exist for external programs to retrieve. If a true environment variable of the same name is defined, it takes precedence over the corresponding variable until the environment variable is deleted again. They are not case-sensitive. While almost all such variables are prefixed with an (" ") by 4DOS etc. by convention (f.e.  ), they are not under DR-DOS   (f.e.  ).

In addition, 4DOS, 4OS2, 4NT, and Take Command also support so called variable functions, including user-definable ones. They work just like internal variables, but can take optional parameters (f.e. ) and may even change the system status depending on their function.

System information variables supported by DR-DOS :


 * : This pseudo-variable returns the ante- or post-midday status of the current time. The returned string depends on the locale-specific version of DR-DOS, f.e. " " or " " in the English version. It resembles an identically named identifier variable in login scripts.


 * : This pseudo-variable returns the days of the current date in a 2-digit format with leading zeros, f.e. " ".." ". See also the similar pseudo-variable . It resembles an identically named identifier variable in  login scripts.


 * : This pseudo-variable returns the day name of the week in a 3-character format. The returned string depends on the locale-specific version of DR-DOS, f.e. " ", " ", " ", " ", " ", " ", or " " in the English version. It resembles an identically named identifier variable in login scripts.


 * : In  of DR-DOS 7.02 and higher, this pseudo-variable returns the last error level returned by an external program or the   command, f.e. " ".." ". See also the identically named pseudo-variable   under Windows and the   conditional command.


 * : In DR-DOS 7.02 and higher, this pseudo-variable returns the last error level in a 3-digit format with leading zeros, f.e. " ".." ". Under, this is a true environment variable automatically updated by the shell to the return code of exiting programs. See also the related pseudo-variable  under DR-DOS and the   command.


 * : This pseudo-variable returns the 3-level day greeting time. The returned string depends on the locale-specific version of DR-DOS, f.e. " ", " ", or " " in the English version. It resembles an identically named identifier variable in login scripts.


 * : This pseudo-variable returns the hours of the current time in 12-hour format without leading zeros, f.e. " ".." ". It resembles an identically named identifier variable in login scripts.


 * : This pseudo-variable returns the hours of the current time in 24-hour format in a 2-digit format with leading zeros, f.e. " ".." ". It resembles an identically named identifier variable in login scripts. See also the similar pseudo-variable.


 * : This pseudo-variable returns the minutes of the current time in a 2-digit format with leading zeros, f.e " ".." ". It resembles an identically named identifier variable in login scripts. See also the similar pseudo-variable.


 * : This pseudo-variable returns the months of the current date in a 2-digit format with leading zeros, f.e. " ".." ". It resembles an identically named identifier variable in login scripts. See also the similar pseudo-variable.


 * : This pseudo-variable returns the month name of the current date. The returned string depends on the locale-specific version of DR-DOS, f.e. " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", or " " in the English version. It resembles an identically named identifier variable in login scripts.


 * : This pseudo-variable returns the number of day of the current week, f.e. " ".." " (with " " for Sunday). It resembles an identically named identifier variable in login scripts.


 * : This pseudo-variable returns the version of the operating system depending on the current setting of the environment variable . If   is not defined,   returns " ". It resembles an identically named identifier variable in  login scripts, which may return versions also for non-DR-DOS versions of DOS.


 * : This pseudo-variable returns the seconds of the current time in a 2-digit format with leading zeros, f.e. " ".." ". It resembles an identically named identifier variable in login scripts. See also the similar pseudo-variable.


 * : This pseudo-variable returns the year of the current date in a 2-digit format with leading zeros, f.e. " ".." ", " ".." ". It resembles an identically named identifier variable in login scripts.


 * and : Supported since, the   pseudo-variable returns the year of the current date in a 4-digit format, f.e. " ".." ". It resembles an identically named identifier variable in  login scripts. DR-DOS 7.02 and higher added   for compatibility with , returning the same value.


 * : In  of DR-DOS 7.02 and higher, this pseudo-variable returns the current  setting of the system, either " " (DOS style) or " " (Unix style). See also the related   directive  and the environment variable.


 * : This pseudo-variable returns the systems' current (" ".." "), f.e. " ", " ", " ". This variable was originally introduced by, but also became available with   since DR-DOS 7.02. See also the   command.


 * : This pseudo-variable returns the current number of screen columns depending on the display mode, f.e. " ", " ", " ", etc. This variable was originally introduced by, but also became available with  since DR-DOS 7.02. See also a similar environment variable   under DOS Plus.


 * : This pseudo-variable returns the systems' current (" ".." "), f.e. " " for USA, " " for UK, " " for Germany, " " with, " " with ISO 8601 and  support. This variable was originally introduced by , but also became available with   since DR-DOS 7.02. See also the   directive.


 * : This pseudo-variable returns the days of the current date without leading zeros, f.e. " ".." ". This variable was originally introduced by, but also became available with  since DR-DOS 7.02. See also the similar pseudo-variable.


 * : This pseudo-variable returns the hours of the current time in 24-hour format without leading zeros, f.e. " ".." ". This variable was originally introduced by, but also became available with  since DR-DOS 7.02. See also the similar pseudo-variable.


 * : This pseudo-variable returns the minutes of the current time without leading zeros, f.e " ".." ". This variable was originally introduced by, but also became available with  since DR-DOS 7.02. See also the similar pseudo-variable.


 * : This pseudo-variable returns the months of the current date without leading zeros, f.e. " ".." ". This variable was originally introduced by, but also became available with  since DR-DOS 7.02. See also the similar pseudo-variable.


 * : This pseudo-variable returns the current number of screen rows depending on the display mode, f.e. " ", " ", " ", etc. This variable was originally introduced by, but also became available with  since DR-DOS 7.02. See a similar environment variable   under DOS Plus.


 * : This pseudo-variable returns the seconds of the current time without leading zeros, f.e. " ".." ". This variable was originally introduced by, but also became available with  since DR-DOS 7.02. See also the similar pseudo-variable.

System information variables supported by DR-DOS  with networking loaded:


 * : This pseudo-variable returns the user name. This always worked with, but it will also work with 's / if the current drive is a PNW-mapped drive (otherwise an empty string is returned). See also the similarly named environment variable.


 * : This pseudo-variable returns the physical station number in a format " ". The value depends on the of the network adapter, but can be overridden. It resembles an identically named identifier variable in  login scripts.


 * : This pseudo-variable returns the logical station number starting with " " for the first client. The numbers are assigned by the file server and remain static for as long as the connection remains established. It resembles an identically named identifier variable in  login scripts.


 * : This pseudo-variable returns the full name of the logged in user, if available. It resembles an identically named identifier variable in login scripts. See also the related pseudo-variable.

Windows
Dynamic environment variables (also named internal variables or system information variables under DOS) are pseudo-environment variables supported by  when command-line extensions are enabled, and they expand to various discrete values whenever queried, that is, their values can change when queried multiple times even within the same command. While they can be used in batch jobs and at the prompt, they are not stored in the environment. Consequently, they are neither listed by  nor do they exist for external programs to read. They are not case-sensitive.

Indirectly, they are also supported under Windows', which has been modified to internally call   to execute the commands.


 * : This pseudo-variable expands to the current directory equivalent to the output of the command  when called without arguments. While a long filename can be returned under   depending on the current directory, the fact that the current directory will always be in  format under   will cause it to return a short filename under , even when   internally calls.


 * : This pseudo-variable expands to the original startup parameters of, f.e. " ". Under Windows'  , this may return something like " " due to the fact that   calls   internally.


 * : This pseudo-variable expands to the version of the command-line extensions of, if enabled (e.g. " " under , " " under  and ).


 * : This pseudo-variable expands to the current date. The date is displayed according to the current user's preferences.


 * : This pseudo-variable expands to the last set error level, a value between " " and " " (without leading zeros). External commands and some internal commands set error levels upon execution. See also the identically named pseudo-variable  under DR-DOS and the   command.


 * : This pseudo-variable returns a random number between " " and " ".


 * : This pseudo-variable returns the current time. The time is displayed according to the current user's time format preferences. If the  and   variables are both used, it is important to read them both in this particular order in rapid succession in order to avoid midnight-rollover problems.