This page uses JavaScript. For the optimal Spencerberus experience, please enable JavaScript or use a browser that supports JavaScript.
PDF

spencerberus

windows/dos environment variables

Variable: Returns: Example | Default:
%ALLUSERSPROFILE% Path to the 'All Users' profile 2000 & XP: C:\Documents and Settings\All Users Vista: C:\Program Data
%APPDATA% Path to directory where applications store data by default 2000 & XP: C:\Documents and Settings\{username}\Application Data Vista: C:\Users\{username}\AppData\Roaming
%CD% Path to current directory
%CMDCMDLINE% Full file path to the current command shell executable( cmd.exe) C:\Windows\system32\cmd.exe
%CMDEXTVERSION% Version of the current Command Processor Extensions 2
%COMPUTERNAME% Local host name {computername}
%COMSPEC% Path to directory containing cmd.exe C:\Windows\System32\cmd.exe
%DATE% Current date, in same format as the date /t command 05/04/08
%ERRORLEVEL% Error code of most recently used command. Usually zero if no error occurred. 0
%HOMEDRIVE% Local drive letter used for user's home directory C:
%HOMEPATH% Path to the user's home directory, excluding leading drive letter 2000 & XP: \Documents and Settings\{username} Vista: \users\{username}
%HOMESHARE% Path shared as user's home drive \\{computername}\c$
%LOGONSERVER% Name of the computer that validated the current logon session. (Domain controller name for domain users; local host name for local user)
%NUMBER_OF_PROCESSORS% Number of processor cores installed on the local host 2
%OS% Operating system name 2000, XP & Vista: Windows_NT
%PATH% Semi-colon delimited list of search paths for executable files C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem
%PATHEXT% Semi-colon delimited list of file extensions the system considers executable .COM; .EXE; .BAT; .CMD; .VBS; .VBE; .JS ; .WSF; .WSH
%PROCESSOR_ARCHITECTURE% Processor's chip architecture x86
%PROCESSOR_IDENTIFIER% Processor's description x86 Family 6 Model 15 Stepping 13, GenuineIntel
%PROCESSOR_LEVEL% Processor's model number 6
%PROCESSOR_REVISION% Processor's revision number 0f0d
%PROGRAMFILES% Default application install path C:\Program Files
%PROMPT% Command prompt settings for the current interpreter; set by cmd.exe $P$G
%RANDOM% Random decimal value between 0 and 32767; generated by cmd.exe
%SYSTEMDRIVE% Drive letter on which Windows is installed C:
%SYSTEMROOT% Windows root directory C:\Windows
%TEMP% Default temporary directory used by applications; same as %TMP% 2000 & XP: C:\Documents and Settings\{username)\Local Settings\Temp Vista: C:\users\{username}\AppData\Local\Temp
%TMP% Default temporary directory used by applications; same as %TEMP% 2000 & XP: C:\Documents and Settings\{username)\Local Settings\Temp Vista: C:\users\{username}\AppData\Local\Temp
%TIME% Current time, in same format as the time /t command 20:51:30.15
%USERDOMAIN%

%USERNAME% Username for current logged in user account {username}
%USERPROFILE% Current user's profile directory 2000 & XP: C:\Documents and Settings\{username} Vista: C:\users\{username}
%WINDIR% Operating system directory C:\Windows



Reference: Microsoft Corp., Command Shell Overview, Microsoft TechNet, 21 Jan 2005, 21 May 2008,

<http://technet2.microsoft.com/WindowsServer/en/library/44500063-fdaf-4e4f-8dac-476c497a166f1033.mspx?pf=true>