Retrieves the value of an environment variable from the current process.
using System; using System.Collections; using System.IO; class Sample { public static void Main() { Environment.CurrentDirectory = Environment.GetEnvironmentVariable("windir"); DirectoryInfo info = new DirectoryInfo("."); lock (info) { Console.WriteLine("Directory Info: " + info.FullName); } } }