tags:

views:

249

answers:

2

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

+14  A: 

This should do it for you:

Path.GetPathRoot(Environment.SystemDirectory)
TheSoftwareJedi
Yep, about as simple as it gets!
Matt Hanson
+1  A: 

All other Environment properties can be found at ms itself : http://msdn.microsoft.com/en-us/library/system.environment_properties.aspx

SystemDirectory - Gets the fully qualified path of the system directory.

JimmyTudeski