How do I get the name of the drive where the operating system is installed?

advertisements

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


This should do it for you:

Path.GetPathRoot(Environment.SystemDirectory)