I want to extend the current PATH variable with a C# program. Here I have several problems:
Using GetEnvironmentVariable(\"PATH\", EnvironmentVariable
You could go through the registry...
string keyName = @"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment";
//get raw PATH environment variable
string path = (string)Registry.GetValue(keyName, "Path", "");
//... Make some changes
//update raw PATH environment variable
Registry.SetValue(keyName, "Path", path);