cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Qingsong
Level 5

How to detect USB hard disk as a removable disk

I am using GetDiskInfo to check the USB hard disk (which has about 1 TB in size).

Returned nDriveType is DRIVE_FIXED.

Is there a way to detect this USB disk is a removable disk?

Regards,

Qingsong
Labels (1)
0 Kudos
(1) Reply
MichaelU
Level 12 Flexeran
Level 12 Flexeran

There isn't anything built in to InstallScript for this, however the documentation for the underlying Windows API call (GetDriveType) has some suggestions to use another API (SetupDiGetDeviceRegistryProperty). See http://msdn.microsoft.com/en-us/library/aa364939(VS.85).aspx to start your research. Note that calling this function from InstallScript may not be easy, so it may be more efficient to create your own C++ DLL which wraps the information you want more directly, and call into that DLL instead.
0 Kudos