1

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.

DBedrenko
  • 4,871
  • 4
  • 38
  • 73
  • 1
    I am not so familiar with Windows USB API's but are you sure the manufacturer information is available? Sometimes the devices return id of the actual manufacturer or for example the USB chip vendor instead of the brand the device is sold under. Sometimes some information is completely missing. This page tells you what information you may expect, the string descriptors are not mandatory: http://www.beyondlogic.org/usbnutshell/usb5.shtml#DeviceDescriptors ... perhaps you need to read the vendorId and convert that to a string yourself? – diidu Dec 17 '15 at 14:20
  • @diidu Thanks for the useful link. I'm actually using a utility [FT_Prog](http://www.ftdichip.com/Support/Utilities.htm#FT_PROG) to manually set the "iManufacturer" and "iProduct" fields mentioned in your link on my device. So the information is definitely there. I don't want to convert the VendorID to a name, because the manufacturer is someone other than FTDI--the vendor. – DBedrenko Dec 17 '15 at 14:42
  • Keep in mind that "the info is definitely there" could be because FT_Prog is converting vendor ids into vendor names - which is what diidu is suggesting you do. I suggest downloading USBVIEW and see what it says about your device. – Χpẘ Dec 19 '15 at 05:04
  • Have you tried WMI like in this [question](http://stackoverflow.com/questions/33911001/how-to-extract-a-particular-attribute-from-instance-of-win32-pnpentity)? – Mark Dec 20 '15 at 14:29
  • @user2460798 I'm sure the info is there because I set the "iManufacturer" field myself to my company's name, using FT_Prog. Indeed, USBView confirms this. – DBedrenko Dec 21 '15 at 09:10
  • @Mark I wasn't even aware of the WMI Python package, thanks! I will try to get it to work – DBedrenko Dec 21 '15 at 09:29

0 Answers0