Variable | Default value: Windows XP |
Default value: Windows 7/2008 |
---|---|---|
%ALLUSERSPROFILE% | C:\Documents and Settings\All Users | C:\ProgramData |
%APPDATA% | C:\Documents and Settings\{username}\Application Data | C:\Users\{username}\AppData\Roaming |
%CommonProgramFiles% | C:\Program Files\Common Files | C:\Program Files\Common Files |
%COMMONPROGRAMFILES(x86)% | C:\Program Files (x86)\Common Files | C:\Program Files (x86)\Common Files |
%COMPUTERNAME% | {computername} | {computername} |
%COMSPEC% | C:\Windows\System32\cmd.exe | C:\Windows\System32\cmd.exe |
%HOMEDRIVE% | C: | C: |
%HOMEPATH% | \Documents and Settings\{username} | \Users\{username} |
%LOCALAPPDATA% | N/A (but can be manually added LOCALAPPDATA=%USERPROFILE%\Local Settings\Application Data) |
C:\Users\{username}\AppData\Local |
%LOGONSERVER% | \\{domain_logon_server} | \\{domain_logon_server} |
%PATH% | C:\Windows\System32\;C:\Windows\;C:\Windows\System32\Wbem;{plus program paths} | C:\Windows\System32\;C:\Windows\;C:\Windows\System32\Wbem;{plus program paths} |
%PATHEXT% | .COM; .EXE; .BAT; .CMD; .VBS; .VBE; .JS ; .WSF; .WSH; The syntax is like the PATH variable - semicolon separators. |
.COM; .EXE; .BAT; .CMD; .VBS; .VBE; .JS ; .WSF; .WSH; .MSC |
%ProgramData% | N/A | C:\ProgramData |
%ProgramFiles% | C:\Program Files | C:\Program Files |
%ProgramFiles(x86)% 1 | C:\Program Files (x86) | C:\Program Files (x86) |
%PROMPT% | Code for current command prompt format,usually $P$G C:> |
Code for current command prompt format,usually $P$G C:> |
%PSModulePath% | N/A | %SystemRoot%\system32\WindowsPowerShell\v1.0\Modules\ |
%Public% | N/A | C:\Users\Public |
%SYSTEMDRIVE% | C: | C: |
%SYSTEMROOT% | C:\Windows | C:\Windows |
%TEMP% and %TMP% | C:\Documents and Settings\{username}\Local Settings\Temp | C:\Users\{Username}\AppData\Local\Temp |
%USERDOMAIN% | {userdomain} | {userdomain} |
%USERNAME% | {username} | {username} |
%USERPROFILE% | %SystemDrive%\Documents and Settings\{username} | %SystemDrive%\Users\{username} |
%WINDIR% | C:\Windows | C:\Windows |
Environment variables are stored in the registry:
User Variables: HKEY_CURRENT_USER\Environment
System Variables: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
http://ss64.com/nt/syntax-variables.html