Get Windows Directory

SIMIN

Well-known member
Joined
Mar 10, 2008
Messages
92
Hi
Is there any other/better way to get the windows directory rather than this method:

Environ("windir") ???
 
Environment.GetFolderPath

C#:
//Get the system directory
sysDir = Environment.GetFolderPath(Environment.SpecialFolder.System);
//Get the Windows directory
winDir = Directory.GetParent(sysDir).ToString();

Directory is a class in the System.IO namespace.
 
Back
Top