C# – How to get the name of the drive that the OS is installed on

.netc++

In C#, how do I get the name of the drive that the Operating System is installed on?

Best Solution

This should do it for you:

Path.GetPathRoot(Environment.SystemDirectory)