[python-win32] Read USB memory stick serial number

Tim Roberts timr at probo.com
Wed Dec 30 01:03:02 CET 2009


python at bdurham.com wrote:
> Cheers for the great solution!!
>
> Your code gives me an easy to parse string containing the same serial
> number as reported by USBDeview.exe.
>   

As a driver writer, I am now required by law to give you the "party
line" speech.  For USB devices that have a serial number descriptor, the
PnP device ID (in the "device path") happens to include that serial
number.  However, the format of the device ID is undocumented and,
officially, subject to change at any time.  Those of us who have been
working with it know that this format has remained the same since PnP
was introduced, and it is vanishingly unlikely that it will ever change
in the future.  However, the official word is that you should treat the
device path as an opaque token.

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the python-win32 mailing list