SetEnvironmentVariable (kernel32)
Last changed: BK-66.46.213.4

.
Summary
Sets the contents of the specified environment variable for the current process (AND NOT TO THE SYSTEM ENVIRONMENT)

C# Signature:

[DllImport("kernel32.dll", SetLastError=true)]
static extern bool SetEnvironmentVariable(string lpName, string lpValue);

VB Signature:

<System.Runtime.InteropServices.DllImport("kernel32.dll", SetLastError:=True)> _
friend shared function SetEnvironmentVariable(lpName as String, lpValue as String) as boolean
end function

User-Defined Types:

None.

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

Please add some!

Alternative Managed API:

.NET FrameWork 2.0: Environment.SetEnvironmentVariable (String, String)

Documentation