Common Windows Environment Variables (Windows key + r)

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
%SystemDirectory% C:\WINDOWS\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)
C:\Documents and Settings\Usr

\Local Settings\Temp

%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):
\Users\<USERNAME> on

Windows Vista & 2008
\Documents and Settings

\Guest on Windows XP

%OS% Windows_NT (even on Windows

Vista & XP machines
The operating system the user is running

%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

About onlinejt


No comments yet.

Leave a Reply