Microsoft – Windows – OS – Environment Variables


Microsoft – Windows – OS – Environment Variables

Before the MS Windows Registry, Configuration files (ini, xml, etc), the environment variables was one of the preferred methods of keeping secrets ( state data, configuration items).

Like LDAP\DNS, the Registry is able to keep data in a hierarchy, tree like format; thus making it amenable for different Vendors\Applications\Purposes.

And, XML files are very good as the data can be well defined (data elements and types).

But, somehow Environment Variables live on, though their usage is a regulated to system purposes such as

  1. path  -> the folders that the system checks when trying to resolve a file\executable location)
  2. Temp –>  Location to save temporarily created folders
  3. Tmp –> same as Temp
  4. WinDir –> Windows System’s Folder
  5. ALLUSERSPROFILE –> The root folder where non-user specific are saved
  6. CLASSPATH–> Folders to check when looking for Java’s class files
  7. LOGONSERVER –> Domain Controller that authenticated user’s logon
  8. NUMBER_OF_PROCESSORS –> Number of CPUs on the machine

There are a couple of different areas that “environment variables” are exposed:

  • System (Default)
  • User (User Specific) – Specially customized for each account
  • Process (Process Specific – Upon Application launch an Application inherits the environment variable specified for its “Logon Account” or the System’s default if the Logon Account does not have settings defined)

Here are some use-cases

To customize environment variable for the currently logged on Account:

  1. Launch Control Panel
  2. Change to “Classic” mode if not already in “Classic” mode
  3. Select the “System” applet
  4. In the “System Property” window, Select the “Advanced” Tab
  5. Click on “Environment Variables” button

To customize environment variable for another account:

  1. Launch Control Panel
  2. Change to “Classic” mode if not already in “Classic” mode
  3. Select the “Administrative Tools” applet
  4. Select the “Computer Management” applet
  5. Within “Computer Management”, right-click the root node and select “Properties”
  6. Within “Computer Management (xxx) Properties, select the “Advanced” Tab
  7. Within the “Environment Variables” group-box, click on the “Settings” button
  8. Within the “Environment Variables” window, in the “User Variables” drop-down, select the user
  1. PowerShell Tip of the week – Creating and modifying environment variable

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s