Is it possible to determine if an SSD drive is connected on USB or if is fixed disk (connected to motherboard)?
Asked
Active
Viewed 299 times
0
-
This is a platform specific issue and you forgot to mention the platform and OS. – Thomas Matthews Nov 06 '19 at 15:54
-
I work in Windows – Zbîrnea Tiberiu Nov 06 '19 at 21:00
1 Answers
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.

EylM
- 5,967
- 2
- 16
- 28