1. Home
  2. Computing & Technology
  3. PC Support

Environment Variable

By , About.com Guide

Definition: An environment variable is a dynamic value that the operating system and other software can use to determine information specific to your computer.

Some of the most common environment variables in Windows systems include %path%, %programfiles%, %systemroot%, and %temp%, though there are many others.

For example, when Windows XP is first installed, the %systemroom% environment variable is set to the directory in which it's installed to. Since the installation directory is something the installer can define, in one computer it might be C:\Windows but in another it may be C:\WinXP.

Continuing with this example, suppose a word processing program is installed on both computers. A number of files need to be installed into the directory that Windows XP is installed in. However, if this can be different from computer to computer, how can the word processing program be sure it's installing the files in the right place?

To prevent a potential problem like this, the word processing program was designed to install to %systemroot%, not C:\Windows. This way, it can be sure that these important files are installed in the same directory as Windows XP, no matter where that might be.

Examples:
"As my hard drive filled up, I changed the %temp% environment variable to a folder on another drive. That forced all of the temporary and other junk files to accumulate on my much bigger second hard drive."
Explore PC Support
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. PC Support
  4. Glossary / Terms
  5. E
  6. Environment Variable - What is an Environment Variable?>

©2009 About.com, a part of The New York Times Company.

All rights reserved.