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#?