Groups | Blog | Home
all groups > dotnet sdk > march 2004 >

dotnet sdk : Find OS installed partition


Arr S
3/21/2004 12:31:08 AM
Hi
I am developing a dll in C#. This has to find the root directory(partition) in which the currently running Operating System is installed. Is there a way to do it and how
Thanks in advance
Abhishek Srivastava
3/21/2004 2:21:54 PM
You can find out the system directory of the current OS by the property

Environment.SystemDirectory

This will give you someting like "E:\Windows\System32".

or read an environemnt variable called "SystemRoot" which will give you
"E:\Windows"

if you are interested only in the drive(partition) in which the current
os is installed Then read an environment variable called SystemDrive
which will give you "E:"

hope this helps.

regards,
Abhishek.

[quoted text, click to view]
AddThis Social Bookmark Button