0

Is it possible to determine if an SSD drive is connected on USB or if is fixed disk (connected to motherboard)?

hippietrail
  • 15,848
  • 18
  • 99
  • 158

1 Answers1

2

If you are on Windows, you can use GetDriveType.

Sample usage:

UINT nType = GetDriveType(_T("C:\\"))

Return values for nType:

DRIVE_FIXED: The drive has fixed media; for example, a hard disk drive or flash drive.

DRIVE_REMOVABLE: The drive has removable media; for example, a floppy drive, thumb drive, or flash card reader.

To check if it's USB drive, you must call for SetupDiGetDeviceRegistryProperty.

You can find a sample code here and here.

EylM
  • 5,967
  • 2
  • 16
  • 28