Sometimes you will need to work with standard or custom files that are present in the Microsoft Windows system folder. This special folder holds files that are required by the operating system. The location of the folder is determined by the version of Windows being used and the configuration used during the operating system's installation.
It is a simple task to identify the path to the system folder when using the .NET framework. You can use methods that I've described in earlier articles, such as using the Environment class's GetFolderPath method and passing the System constant. However, although this method is more flexible, when you only need the path of the system folder, using the SystemDirectory property can be more readable. This static property returns a string containing the full path to the system folder.
Console.WriteLine(Environment.SystemDirectory); // Outputs "C:\windows\system32"
2 May 2014