System.EnvironmentVariableTarget Enumeration

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

Syntax

[System.Runtime.InteropServices.ComVisible(true)]
public enum EnvironmentVariableTarget

Remarks

The EnvironmentVariableTarget enumeration is used by certain overloads of the erload:System.Environment.SetEnvironmentVariable, erload:System.Environment.GetEnvironmentVariable, and erload:System.Environment.GetEnvironmentVariables 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.

Members

Member NameDescription
Machine

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.

Process

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

User

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

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0