mscorlib 2.0.0.0 4.0.0.0 System.Enum System.Runtime.InteropServices.ComVisible(true)

The enumeration is used by certain overloads of the , , and methods to specify the location, or target, where the name and value of an environment variable is stored or retrieved.

The target can be one of three locations: the environment block associated with the current process, the Windows operating system registry key reserved for environment variables associated with the current user, or the registry key reserved for environment variables associated with all users on the local machine.

Specifies the location where an environment variable is stored or retrieved in a set or get operation.

- Field
  2.0.0.0
  4.0.0.0
  System.EnvironmentVariableTarget

  When a user creates the environment variable in a set operation, the operating system stores the environment variable in the system registry, but not in the current process. If any user on the local machine starts a new process, the operating system copies the environment variable from the registry to that process.

  When the process terminates, the operating system destroys the environment variable in that process. However, the environment variable in the registry persists until a user removes it programmatically or by means of an operating system tool.

  The environment variable is stored or retrieved from the HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment key in the Windows operating system registry.

- Field
  2.0.0.0
  4.0.0.0
  System.EnvironmentVariableTarget

  The user creates the environment variable in a set operation.

  When the process terminates, the operating system destroys the environment variable in that process.

  The environment variable is stored or retrieved from the environment block associated with the current process.

- Field
  2.0.0.0
  4.0.0.0
  System.EnvironmentVariableTarget

  When the user creates the environment variable in a set operation, the operating system stores the environment variable in the system registry, but not in the current process. If the user starts a new process, the operating system copies the environment variable from the registry to that process.

  When the process terminates, the operating system destroys the environment variable in that process. However, the environment variable in the registry persists until the user removes it programmatically or by means of an operating system tool.

  The environment variable is stored or retrieved from the HKEY_CURRENT_USER\Environment key in the Windows operating system registry.