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

cnet

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

Best Answer

This should do it for you:

Path.GetPathRoot(Environment.SystemDirectory)