To get a complete list of the environmental variables on your system, all you need to do is type set
into a CMD prompt. Here are some of the most common, most useful environment variables for Windows:
Location | Notes | Win7 x64 | Vista x64 | Vista x86 | XP |
---|---|---|---|---|---|
All Users Desktop | – | C:\Users\Public\Desktop | C:\Users\Public\Desktop | C:\Users\Public\Desktop | C:\Documents and Settings\All Users\Desktop |
All Users Start Menu | – | C:\ProgramData\Microsoft\Windows\Start Menu | C:\ProgramData\Microsoft\Windows\Start Menu | C:\ProgramData\Microsoft\Windows\Start Menu | C:\Documents and Settings\All Users\Start Menu |
ALLUSERSPROFILE | All Users Profile | C:\ProgramData | C:\ProgramData | C:\ProgramData | C:\Documents and Settings\All Users |
APPDATA | – | C:\Users\username>\AppData\Roaming | C:\Users\username\AppData\Roaming | C:\Users\username\AppData\Roaming | C:\Documents and Settings\username\Application Data |
CommonProgramFiles | – | C:\Program Files\Common Files | C:\Program Files\Common Files | C:\Program Files\Common Files | C:\Program Files\Common Files |
CommonProgramFiles(x86) | Common 32bit Program Files on 64bit machine | C:\Program Files (x86)\Common Files | C:\Program Files (x86)\Common Files | – | – |
HOMEDRIVE | – | C: | C: | C: | C: |
HOMEPATH | Location of User Profile while user is logged in (not location of roaming profile) | \Users\username | \Users\username | \Users\username | \Documents and Settings\username |
IE Favorites | – | C:\Users\username\Favorites | C:\Users\username\Favorites | C:\Users\username\Favorites | C:\Documents and Settings\username\Favorites |
Links | – | C:\Users\username\Links | C:\Documents and Settings\username\Links | – | – |
LOCALAPPDATA | Mozilla Profile in Vista | C:\Users\username\AppData\Local | C:\Users\username\AppData\Local | C:\Users\username\AppData\Local | – |
Mozilla Profile | – | C:\Users\username\AppData\Roaming\Mozilla\Firefox\Profiles | C:\Users\username\AppData\Local\Mozilla\Firefox\Profiles | C:\Users\username\AppData\Local\Mozilla\Firefox\Profiles | C:\Documents and Settings\username\Application Data\Mozilla\Firefox\Profiles |
ProgramData | MST Login Scripts, All Users Profile | C:\ProgramData | C:\ProgramData | C:\ProgramData | – |
ProgramFiles | 32bit programs for 32bit OS, 64bit programs for 64bit OS | C:\Program Files | C:\Program Files | C:\Program Files | C:\Program Files |
ProgramFiles(x86) | 32bit Program Files on 64bit machine | C:\Program Files (x86) | C:\Program Files (x86) | – | – |
Public | Shared Public Data in Vista | C:\Users\Public | C:\Users\Public | C:\Users\Public | – |
Quick Launch Toolbar | Quick Launch shortcuts | C:\Users\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch | C:\Documents and Settings\username\Application Data\Microsoft\Internet Explorer\Quick Launch | C:\Documents and Settings\username\Application Data\Microsoft\Internet Explorer\Quick Launch | C:\Documents and Settings\username\Application Data\Microsoft\Internet Explorer\Quick Launch |
SystemDrive | Drive where Windows is installed | C: | C: | C: | C: |
SystemRoot | Location where Windows is installed | C:\Windows | C:\Windows | C:\Windows | C:\WINNT |
User Desktop | – | C:\Users\username\Desktop | C:\Users\username\Desktop | C:\Users\username\Desktop | C:\Documents and Settings\username\Desktop |
User Documents | – | C:\Users\username\Documents | C:\Users\username\Documents | C:\Users\username\Documents | C:\Documents and Settings\username\My Documents |
USERPROFILE | Profile location | C:\Users\username | C:\Users\username | C:\Users\username | C:\Documents and Settings\username |
WINDIR | Location where Windows is installed | C:\Windows | C:\Windows | C:\Windows | C:\WINNT |
Update: you may have noticed that there is no environment variable that refers to the location of the user’s My Documents directory. Based on this, there isn’t a standard method for setting a program’s home directory to be the My Documents directory. You can easily navigate to this by adding the documents directory to the %userprofile%
variable – %userprofile%\documents
.
What are Environment Variables Used For?
Environment variables help programs know what directory to install normal files, where to store temporary files, and where to find user profile info.
One environment variable that started in Vista and still sees heavy use today is %appdata%
. This variable points to the location of data made by programs specific to users, such as browsers. If you type or paste this variable name into a run box or explorer window, it will open up the AppData\Roaming
folder under your user profile.
As you’ve seen, this is but one of many useful variables you can use to not only open specific locations faster, but also to easily script and automate some tasks.
What useful environment variables for Windows do you use the most? While you’re looking for time testing Windows tips and shortcuts, head over to the most useful shell commands for Windows.