WinAPI calls to access USB storage which has no drive letter?

后端 未结 3 1623
走了就别回头了
走了就别回头了 2021-02-15 15:18

I\'ve noticed, that some USB storage devices don\'t register in Windows as regular drives, in that they don\'t even get assigned a drive letter. Therefore, I can\'t apparently a

3条回答
  •  无人及你
    2021-02-15 15:50

    Yes. There are few cases a USB drive doesn't have a drive letter.

    1. Bluetooth device, USB camera doesnt have drive letter. but this is not your case, since you mentioned storage device.
    2. A USB storage device which is registered in PC not as a storage device. eg. USB MP3 player (MTP device) will be detected as Music Player and doesn't have a drive letter.

    I believe yours is case #2.

    In order to access files in a storage device, you need to force mount it as a storage device with drive letter. Unless you have a mount point, you cannot access the files i believe. This depends on the devices. Some devices (MTP) have internal settings to decide whether to detect as storage or not. You can explore the settings in the MTP device.

    Otherwise you need to force all the storage device to mount through code.

提交回复
热议问题