1

I have a set of encrypted SATA drives, some are internal to my machine, and others are connected via USB external enclosures. I can't give the external ones drive letters because Windows will keep asking to format them every time they're connected.

Each volume has a different password, and should use a different, specific drive letter when mounted. For this reason I'd like to be able to uniquely identify these drives, programmatically, when they're connected.

I can grab serial numbers via C#/WMI for the internal drives, but this doesn't work for the ones housed in the external USB enclosures - when not mounted locally, I get a single odd symbol for the serial number.

I can't give these drives a label to get around this problem, because Windows (7) demands that I format them first.

Clearly Windows has a way of uniquely identifying these external drives, because it remembers any drive letters I give them. But how is it doing that? Is it possible to do the same using C#?

PJ7
  • 763
  • 5
  • 15
  • What WMI command are you using to get the serial number? And have you seen [this post](http://stackoverflow.com/a/4084573/5095502): "If you need a unique identifier, use a combination of these IDs."? – Quantic Jan 17 '17 at 19:42
  • I use basically the same WMI call that's in your suggestion. But the question is - is the Signature property unique? Model, Manufacturer, and TotalHeads will be identical in many cases, and the first two aren't even reliable when accessing the drive from a USB enclosure. Signature may indeed be what I'm looking for - it looks unique across all my drives. – PJ7 Jan 17 '17 at 20:18

0 Answers0