I am trying to get the Manufacturer field of a USB device I have plugged-in. The "Properties" dialog of the device in Windows reports:
Device description: USB Serial Converter
Device type: Universal Serial Bus controllers
USB tools like FT_Prog and Microsoft USBView report that the "iManufacturer" device descriptor field of my device is set to "MyCompanyFoo".
So far, using the pywin32 package, I was able to get the VendorID, DeviceID and SerialNumber of the device:
import win32com.client
wmi = win32com.client.GetObject("winmgmts:")
for usb in wmi.InstancesOf("Win32_UsbHub"):
print 'DeviceID: ' + str(usb.DeviceID)
However the Win32_UsbHub
structure does not contain the "Manufacturer" attribute.
I tried instead to use the Win32_USBController
WMI structure which does have this attribute:
for usb in wmi.InstancesOf ("Win32_UsbController"):
print 'Manufacturer: ' + str(usb.Manufacturer)
but it's output is incorrect for my purposes (it should be "MyCompanyFoo"):
Manufacturer: Intel
Manufacturer: Intel
Manufacturer: Intel(R) Corporation
Win32_DiskDrive
WMI class prints the same wrong output.
I know of alternative solutions for this task like "PyUSB" with "libusb1.0" backend, but these require installing a driver dependency which I can't afford.