-----Original Message-----
Hi Eric,
If you need to set these in the context of a new Process you are launching,
check out the ProcessStartInfo.EnvironmentVariables collection. It is read
only but you can get a reference to it and modify the reference directly:
ProcessStartInfo psi = new ProcessStartInfo();
...
string name = "some_env_var";
string val = "c:\adirectory";
psi.EnvironmentVariables[name] = val;
Then you can launch your Process with this psi object.
If this context is not useful to you, you could always import the Win32 API
routine to use it:
[DllImport("kernel32.dll")]
public static extern uint SetEnvironmentVariable(
lpName,
string lpValue );
Then you can call this method from your managed code (you'll need to
declare using System.Runtime.InteropServices).
Hope this helps, let me know if I can provide any more info.
Jeff.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.
.