Environment variables are strings that contain information such as drive, path, or file name. They control the behavior of various programs. For example, the TEMP environment variable specifies the location in which programs place temporary files.
Instead of using the mouse to get to a folder in Windows you can simple press the Windows key + r and type the variable name like %Temp%.
Variable | Sample Typical Value |
%SystemDrive% | C: |
%SystemRoot% | C:\WINDOWS C:\WINNT |
%WinDir% | C:\WINDOWS C:\WINNT |
%SystemDirectory% | C:\WINDOWS\System32 C:\WINNT\System32 |
%ComSpec% | C:\WINDOWS\system32\cmd.exe |
%programfiles% | C:\WINDOWS\Program Files |
%Temp% | C:\Users\W\AppData\Local\Temp
on Windows Vista & 2008 (compressed form of) \Local Settings\Temp |
%Tmp% | |
%HOMEDRIVE% | C: The drive letter associated with
the user’s home directory |
%HOMEPATH% | The path to the user’s home
directory as defined in UMD/AD (excluding drive): Windows Vista & 2008 \Guest on Windows XP |
%OS% | Windows_NT (even on Windows
Vista & XP machines |
%USERDOMAIN% | The name of the domain that
contains the user’s account. On a stand-alone machine, the same as the machine name. |
%USERNAME% | The user’s name |
%USERPROFILE% | C:\Users\<USERNAME> — The user’s root folder |
%USERPROFILE%\Desktop | The user’s desktop folder |