This is list of Windows Environment Variables. What are environment variables? Environment Variables are shortcuts to different parts of the Windows File Structure, they are mostly useful at the command line or batch scripts.
Variable | Windows 2000/XP | Windows Vista/7/8 |
%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% | (Computer Name) | (Computer Name) |
%COMSPEC% | C:\Windows\System32\cmd.exe | C:\Windows\System32\cmd.exe |
%HOMEDRIVE% | C: | C: |
%HOMEPATH% | C:\Documents and Settings\{username} | C:\Users\{username} |
%LOCALAPPDATA% | N/a | C:\Users\{username}\AppData\Local |
%LOGONSERVER% | \\{domain_logon_server} | \\{domain_logon_server} |
%PATH% | System Path | System Path |
%PATHEXT% | .COM; .EXE; .BAT; .CMD; .VBS; .VBE; .JS ; .WSF; .WSH; | .COM; .EXE; .BAT; .CMD; .VBS; .VBE; .JS ; .WSF; .WSH; .MSC |
%ProgramData% | N/a | C:\ProgramData |
%ProgramFiles% | C:\Program Files | C:\Program Files |
%ProgramFiles(x86)% | C:\Program Files (x86) | C:\Program Files (x86) |
%PROMPT% | Code for current command prompt format,usually $P$G | Code for current command prompt format,usually $P$G |
%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% | Connected Domain Controller | Connected Domain Controller |
%USERNAME% | Username | Username |
%USERPROFILE% | %SystemDrive%\Documents and Settings\{username} | %SystemDrive%\Users\{username} |
%WinDir% | C:\Windows | C:\Windows |
%CD% | Current Path | Current Path |
%Time% | (See Note) | This variable points to the current time. The time is displayed according to the current user’s time format preferences. |
%Random% | (See Note) | This variable returns a random number between 0 and 32767. |
Know of any that I missed? Share them in the comments.