how to get disk properties?

Jun 12, 2009 at 2:14am
2 aim that i want to achieve

1) get disk properties, i want to find out a disk C: D: E: etc , which is local disk,not removeable USB / optical disk

2) get the current running windows installationlocation-->which partition (C: D: E:)

thanks
Last edited on Jun 12, 2009 at 2:35am
Jun 12, 2009 at 2:27am
1) I think GetDriveType or some similar function does this.

http://msdn.microsoft.com/en-us/library/aa364939.aspx <---- GetDriveType seems rather simplistic. Perhaps too much so

http://msdn.microsoft.com/en-us/library/aa364993(VS.85).aspx <--- also GetVolumeInformation seems much more detailed, but also more complicated. I've never used this function though.

2) Probably can use getenv(). Surely there must be SOME environment variable that has the installation directory. Don't know which though.
Jun 12, 2009 at 3:35am
for get the current running windows installation location, i have a idea that get the current running proccess- kernel32.dll , and get its path , than we casn know which partition label the user install windows on it~ ~

would anyone know how to do it?
Jun 12, 2009 at 5:23pm
To get the current windows directory, use GetWindowsDirectory().
http://www.google.com/search?btnI=1&q=msdn+GetWindowsDirectory

You can get the drive off of that.
Topic archived. No new replies allowed.