C# Finding the Path to the Windows Folder

The "SpecialFolder" enum of the "Environment" class is used to find the path to the "Windows" folder (aka SYSROOT) in the C# programming language.

The result C:\WINDOWS will return normally.

Below is an example of how to use it.


string windowsPath = Environment.GetFolderPath(Environment.SpecialFolder.Windows);



You May Interest

C# Linq Contains Method

C# Finding the Path to the Windows System32 Folder

C# How To Find The Average Of 10 Numbers Using A While Loop

C# Finding Tangent of an Angle

C# Finding the Operating System Username