I wish to write a program in c# that determines in which directory the OS is installed.?
I mean in some systems it is in “C” drive and in some systems it is in “D” drive. I wish to know is there any way in C# programming language to know in which hard disk drive the OS is installed.
Regards,
Sai sindhu
Try
UPDATE: you can also use
SpecialFolder.Windowsbut as you can see here it also returns value corresponding to the %windir% or %SYSTEMROOT% environment variables.