Groups | Blog | Home
all groups > asp.net webservices > january 2008 >

asp.net webservices : how set the PATH environment variable to server machine through my application?


chandan
1/7/2008 9:46:02 PM
I want to set the PATH environment variable to server machine through
my application. I am using ASP.net 2.0 and language C#.

Thanks in advance!
Ravi
1/8/2008 8:13:02 AM
Hello,

You can use the following code to change any environment variable.

Environment.SetEnvironmentVariable("PATH","Your value goes here");

Also you can restore the orginial PATH value before program end.

string str = Environment.GetEnvironmentVariable("PATH");

Environment.SetEnvironmentVariable("PATH","Your value goes here");

before program end,

Environment.SetEnvironmentVariable("PATH",str);

Ravi





[quoted text, click to view]
AddThis Social Bookmark Button