If you ever need to set environment variables in .Net 2.0+, you can use these: System.Environment.SetEnvironmentVariable(“MACHINE_VAR”, “Somevalue”, EnvironmentVariableTarget.Machine); System.Environment.SetEnvironmentVariable(“USER_VAR”, “Somevalue”, EnvironmentVariableTarget.User); System.Environment.SetEnvironmentVariable(“PROCESS_VAR”, “Somevalue”, EnvironmentVariableTarget.Process); string env_val = System.Environment.GetEnvironmentVariable( “PROCESS_VAR”, EnvironmentVariableTarget.Process); These however do have their limitations: If your use does not have privileges to the registry or to set environment variables these will not work. …