|
Author: Jenny Nguyen
|
|
Most of the time developer thinks that the default Windows is from this path: C:\Windows or C:\WINNT but this is not always the case. Some people might have the default Operating System install on D: or E:. So to ensure that you always get the accurate Windows system path use this code in your C# code to read the environement variable. private void OnEnabled(object sender, EventArgs e) { string windir = Environment.GetEnvironmentVariable("windir"); string sysRoot = Environment.GetEnvironmentVariable("SystemRoot");
}
|