Q: Common Windows Environment Variables

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.

VariableWindows 2000/XPWindows Vista/7/8
%ALLUSERSPROFILE%C:\Documents and Settings\All UsersC:\ProgramData
%APPDATA%C:\Documents and Settings\{username}\Application DataC:\Users\{username}\AppData\Roaming
%CommonProgramFiles%C:\Program Files\Common FilesC:\Program Files\Common Files
%COMMONPROGRAMFILES(x86)%C:\Program Files (x86)\Common FilesC:\Program Files (x86)\Common Files
%COMPUTERNAME%(Computer Name)(Computer Name)
%HOMEPATH%C:\Documents and Settings\{username}C:\Users\{username}
%PATH%System PathSystem Path
%ProgramFiles%C:\Program FilesC:\Program Files
%ProgramFiles(x86)%C:\Program Files (x86)C:\Program Files (x86)
%PROMPT%Code for current command prompt format,usually $P$GCode for current command prompt format,usually $P$G
%TEMP% and %TMP%C:\Documents and Settings\{username}\Local Settings\TempC:\Users\{Username}\AppData\Local\Temp
%USERDOMAIN%Connected Domain ControllerConnected Domain Controller
%USERPROFILE%%SystemDrive%\Documents and Settings\{username}%SystemDrive%\Users\{username}
%CD%Current PathCurrent 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.


Last updated on


Be the first to comment on this Article

Leave a Comment

Support Options

On Premise Support

Need help in your home or office? No problem, we can come to you!

Learn More

Remote Support

Do you need assistants, but your too busy? Then Remote Support is the Best Option!

Learn More

Get Help Online

Need help right now? Then the forums are the best place for immediate help.



How often do you replace your primary computer?

View Results

Loading ... Loading ...