system phisycal drive
-
How can we determine the phisycal drive where is installed the running operating sistem (windows)?
36. When you surround an army, leave an outlet free. ... Do not press a desperate foe too hard. SUN-TZU - Art of War
GetWindowsDirectory()[^] should help you. It will give you the whole path, but you can find the drive from the path.
"Real men drive manual transmission" - Rajesh.
-
How can we determine the phisycal drive where is installed the running operating sistem (windows)?
36. When you surround an army, leave an outlet free. ... Do not press a desperate foe too hard. SUN-TZU - Art of War
You can use the
ExpandEnvironmentStrings
API with the%SYSTEMDRIVE%
environment variable. -
GetWindowsDirectory()[^] should help you. It will give you the whole path, but you can find the drive from the path.
"Real men drive manual transmission" - Rajesh.
-
GetWindowsDirectory()
returns a path like **X:\**win64. I need to determine what
\\.\PhisycalDriveN
hosts the X: partition. Any solution?
36. When you surround an army, leave an outlet free. ... Do not press a desperate foe too hard. SUN-TZU - Art of War
May be this MSDN example [^] is helpful.
-
May be this MSDN example [^] is helpful.
I write an app for media erasure. It displays via
DISK_GEOMETRY
andDevice IoControl
PhisycalDriveX
. It is important not to try erasure on the phisycal device that holds the OS. So, I need to see if the OS that runs is located on a phisycal drive that I intend to erase. Probably is better to skip that device.36. When you surround an army, leave an outlet free. ... Do not press a desperate foe too hard. SUN-TZU - Art of War
-
I write an app for media erasure. It displays via
DISK_GEOMETRY
andDevice IoControl
PhisycalDriveX
. It is important not to try erasure on the phisycal device that holds the OS. So, I need to see if the OS that runs is located on a phisycal drive that I intend to erase. Probably is better to skip that device.36. When you surround an army, leave an outlet free. ... Do not press a desperate foe too hard. SUN-TZU - Art of War
There is no API function returning the physical devive. You must use
GetWindowsDirectory()
and then determine the device for the drive letter. -
There is no API function returning the physical devive. You must use
GetWindowsDirectory()
and then determine the device for the drive letter. -
... and how to determine the device for the drive letter? :(
36. When you surround an army, leave an outlet free. ... Do not press a desperate foe too hard. SUN-TZU - Art of War
Use the QueryDosDevice[^] function to get the physical device name from the drive name. Make sure the drive name does not contain the trailing '\' (e.g: use "c:" instead of "c:\\") This will give you something like \Device\HardDisk0 or whatever is relevant to your machine. I hope this helps
"It was when I found out I could make mistakes that I knew I was on to something." -Ornette Coleman "Philosophy is a study that lets us be unhappy more intelligently." -Anon.
-
... and how to determine the device for the drive letter? :(
36. When you surround an army, leave an outlet free. ... Do not press a desperate foe too hard. SUN-TZU - Art of War
See the link from my previous post. It does not contain a ready-to-use solution, but contains enough information to do it yourself.
-
How can we determine the phisycal drive where is installed the running operating sistem (windows)?
36. When you surround an army, leave an outlet free. ... Do not press a desperate foe too hard. SUN-TZU - Art of War