Environment variables work like placeholder or alias for drives, file/folder names and various paths.
We here at AskVG frequently use environment variables reference in our tutorials like %windir%\Resources, %programfiles%\Internet Explorer, etc. Many people don't know about them and get confused how to access the mentioned path.
So today we are going to list some important and frequently used system-defined environment variables in this article which will help you in better understanding them.
Most of these environment variables are same for Windows XP and Windows Vista/7 but some are different. So we are listing them separately for XP and Vista/7.
Windows XP Environment Variables
Environment Variable Path %ALLUSERSPROFILE% C:\Documents and Settings\All Users %APPDATA% C:\Documents and Settings\{username}\Application Data %COMMONPROGRAMFILES% C:\Program Files\Common Files %COMMONPROGRAMFILES(x86)% C:\Program Files (x86)\Common Files %COMSPEC% C:\Windows\System32\cmd.exe %HOMEDRIVE% C: %HOMEPATH% C:\Documents and Settings\{username} %PROGRAMFILES% C:\Program Files %PROGRAMFILES(X86)% C:\Program Files (x86) (only in 64-bit version) %SystemDrive% C: %SystemRoot% C:\Windows %TEMP% and %TMP% C:\Documents and Settings\{username}\Local Settings\Temp %USERPROFILE% C:\Documents and Settings\{username} %WINDIR% C:\Windows
Windows Vista and 7 Environment Variables
Environment Variable Path %ALLUSERSPROFILE% C:\ProgramData %APPDATA% C:\Users\{username}\AppData\Roaming %COMMONPROGRAMFILES% C:\Program Files\Common Files %COMMONPROGRAMFILES(x86)% C:\Program Files (x86)\Common Files %COMSPEC% C:\Windows\System32\cmd.exe %HOMEDRIVE% C: %HOMEPATH% C:\Users\{username} %LOCALAPPDATA% C:\Users\{username}\AppData\Local %PROGRAMDATA% C:\ProgramData %PROGRAMFILES% C:\Program Files %PROGRAMFILES(X86)% C:\Program Files (x86) (only in 64-bit version) %PUBLIC% C:\Users\Public %SystemDrive% C: %SystemRoot% C:\Windows %TEMP% and %TMP% C:\Users\{username}\AppData\Local\Temp %USERPROFILE% C:\Users\{username} %WINDIR% C:\Windows
NOTE: Here C: is the system drive where Windows is installed in your system. It might differ for you if you installed Windows in a different drive in your system.
This article was posted by VG in following section: Windows 7, Windows Vista, Windows XP.
If you enjoyed this article, subscribe to our RSS feed or free newsletter to get all new articles directly in your Inbox. Also check out our popular articles and archive to read other interesting articles.
toast
Thanks for this info. Very useful....
toast...
Blac
This i need for handle my OS... It's pretty good... Thanks VG.
wildgoosespeeder
Thanks for the info! I always wanted to know the most used. :D
I assume the reason you use these a lot is because from previous entries you multi boot your computer.
Patrick
This is very useful! I need this for making a manual virus remover. thanks VG
EGA
thanks a lot VG, very useful :)
Danny Roy Jenuil
Really useful. Thanks VG.
Samar
I asked for it and 'Vishal' (huge in Hindi language) hearted Vishal got it!!!!! That's how Vishal he is!!! Thanks!!!
BTW i found a very informative page on this topic on Wikipedia
Veeck
Very useful. Thanks VG
MAGNUMHEART
Thanks. this is what i'm looking for. Nice info VG. Very useful. :)
I need it for my next project. ;)
Sukumaar
Thanks Vishal