Windows Platform Comparison Environment Variable Reference


Variable 

Description

AllUsersProfile Location of the "All Users" or "Common" profile folder. Note: profile paths are localized.        
AppData Base location of where applications should store their data by default. It is up to the author as to what the application should store here, or if they choose to use this folder at all. This is a subdirectory of the user's profile folder.          
CD This hidden variable returns a string that represents the current directory.         ?
ClientName Reports "Console" when logging on directly to the machine.            
CmdCmdLine This hidden variable returns the exact command line used to start the current cmd.exe session.       ?
CmdExtVersion This hidden variable returns the version number of the current Command Processor Extensions. Windows NT returns a value of "1". In Windows 2000 and XP return a "2". This version number will be incremented by one when significant enhancements are addedd to the Command Extensions.      
CommonProgramFiles Path to the common program files folder. Vendors use this folder to store components they may wish to share between their own applications. As such, files are stored in a subdirectory that identifies the vendor. For example, “%CommonProgramFiles%\Symantec Shared” translates to “C:\Program Files\Common Files\Symantec Shared”. This path is localized.          
ComputerName The NetBOIS name of the computer.        
ComSpec The full filespec of the command shell executable. Examples: c:\windows\command.exe, c:\winnt\cmd.exe.
Date This hidden variable returns the current system date using the day of the week followed by the numeric date (MM/DD/YYYY). Example: "Thu 06/23/2005"
ErrorLevel This hidden variable is populated with the Win32 error code of the most recently executed command. A value other than zero usually indicates an error.
HomeDrive Drive letter on the local computer that is connected to the user's home directory. The drive letter to use is defined in the user's account properties within the domain. This variable is based on the value of the home directory. If the home directory is UNC, this variable will be populated with the drive letter that should be mapped to the UNC. If the home directory is a local path, this variable wil lbe populated with the drive letter of the local path.        
HomePath The complete path of the user's home directory, as defined in the user's account properties within the domain. This variable is based on the value of the home directory. If the home directory is a UNC, this variable will will return the path (example: "\<path>") to the user's home directory using the mapped drives as a root. IF the home directory uses a local path, it will return the drive letter of that local path.        
HomeShare The network path to the user's home directory. This variable is based on the value of the home directory. If the home directory is UNC, it will be populated with the server and share name of the home directory (for example "\\server\share"). If the home directory is a local path, it will return a null value.              
LogonServer Indicates which domain controller authenticated the client's logon request.        
Number_of_Processors Quantity of CPUs installed in the system.        
OS Returns "Windows_NT" for Windows NT 'family' systems.      
Os2LibPath Represents the path to its OS2 library files. IF you install Windows NT on a computer that was previously running OS2 1.x, NT picks up the OS2 settings that it finds in the config.sys files and migrates them into the NT registry. IN the process, it appends appropriate paths to point to the NT installation tree where key OS2 subsystem files are stored.            
Path An ordered list of folders that will be searched when the OS is requested to execute an application that includes no specific path in the filespec. Several folders may be specified in the path, separated by semicolons (;).
PathExt Returns a list of the file extensions that the operating system considers to be executable. When executing a command line that does not contain an extension, the command interpreter (cmd.exe) uses the value of this environment variable to determine which extensions to look for and in what order. The default value is ".com; .exe; .bat; .cmd"      
Processor_Architecture Indicates the chip architecture of the CPU.        
Processor_Identifier Returns a description of the CPU (for example: "x86 Family 6 Model 8 Stepping 10, GEnuineINtel").        
Processor_Level Indicates the model number if the CPU installed in the computer, including x86 = 3,4,5 or 6; Alpha = 21064; and MIPS = 3000 or 4000.        
Processor_Revision The revision number of the CPU.        
ProgramFiles Location of the base folder for installed applications. On the US-English version this would typically be "C:\Program Files"          
Prompt The command prompt settings for the current interpreter. This value may be changed using the DOS Prompt command. Example: $P$G.
Random A hidden variable that uses cmd.exe to generate a decimal number between 0 and 32767. Available on Windows 2000 and later systems.         ?
SessionName The SessionName variable is only defined if the Terminal Services system component is installed to the Server Edition of Windows 2000, and Windows XP clients (or newer). When a client connects via a terminal server session, this variable is a combination of the connection name, followed by a pound symbol {#} and then the session number. When logging on directly to the machine, this variable returns "Console".          
SystemDrive Drive that contains the Windows root directory, for example "C:"      
SystemRoot The folder that the operating system has been installed to.      
Temp Points to the default temporary folder that is used by the applications availabe to the currently logged on user. Some applications require %temp% and otehrs require %tmp% -- the values should be identical.  
Time A hidden variable that returns the current system time, to the tenth of a second (for example: "23:59:59:59"
Tmp Points to the default temporary folder that is used by the applications availabe to the currently logged on user. Some applications require %temp% and otehrs require %tmp% -- the values should be identical.  
UserDnsDomain The fully qualified DNS domain that the currently logged on user's account belongs to. For example: "mydomain.local"            
UserDomain Name of the domain that contains the user's account.          
UserName Name (logon ID) of the user the is currently logged on.          
UserProfile Represents the path to the user's profile folder. The default for the US-English version of the OS is "%systemroot%\Documents and Settings\<username>".          
WinBootDir Points to the location where Windows 9X has been installed, usually "C:\Windows".        
WinDir The folder that the users' environment believes the operating system is installed to. Usually the same as SystemRoot, but may not be when a user logs on from a Terminal Server session.
WinStationName The SessionName variable is only defined on the Terminal Services Edition of Windows NT 4.0. When a client connects via a terminal server session, this variable is a combination of the connection name, followed by a pound symbol {#} and then the session number. When logging on directly to the machine, this variable returns "Console". This variable was replaced by the SessionName variable on Windows 2000 and newer.