How do you get the current harddisk drive? Like mine is C: but some people use D:, F:, etc.
Printable View
How do you get the current harddisk drive? Like mine is C: but some people use D:, F:, etc.
Are you looking for SystemRoot.
C# Code:
//Returns path of System32 folder in Windows folder //%SYSTEMROOT%\Windows\System32 string str = System.Environment.SystemDirectory; //Pass this path to get the drive name System.IO.DriveInfo di = new System.IO.DriveInfo(str); Console.WriteLine(di.Name);
thankyou, rated.Quote:
Originally Posted by Harsh Gupta
Glad to help you!!! :wave: