I was trying to get usb-printer name using wmi query via c# application. I use this example. Result was
Device ID: USB\VID_0B0B&PID_106E\5&18F54CB7&0&2, PNP Device ID: USB\VID_0B0B&PID_106E\5&18F54CB7&0&2, Description: USB Printing Support
That's not suiteble for me, in windows device manager it shows as DatamaST-3210. After that, I try to get data using WmiExplorer
select * from Win32_PnPEntity
And I get 2 devices:
instance of Win32_PnPEntity
{
Caption = "USB Printing Support";
ClassGuid = "{36fc9e60-c465-11cf-8056-444553540000}";
CompatibleID = {"USB\\Class_07&SubClass_01&Prot_02", "USB\\Class_07&SubClass_01", "USB\\Class_07"};
ConfigManagerErrorCode = 0;
ConfigManagerUserConfig = FALSE;
CreationClassName = "Win32_PnPEntity";
Description = "USB Printing Support";
DeviceID = "USB\\VID_0B0B&PID_106E\\5&18F54CB7&0&2";
HardwareID = {"USB\\VID_0B0B&PID_106E&REV_0304", "USB\\VID_0B0B&PID_106E"};
Manufacturer = "Microsoft";
Name = "USB Printing Support";
PNPDeviceID = "USB\\VID_0B0B&PID_106E\\5&18F54CB7&0&2";
Service = "usbprint";
SystemCreationClassName = "Win32_ComputerSystem";
};
instance of Win32_PnPEntity
{
Caption = "DatamaxST-3210";
ConfigManagerErrorCode = 0;
ConfigManagerUserConfig = FALSE;
CreationClassName = "Win32_PnPEntity";
Description = "DatamaxST-3210";
DeviceID = "USBPRINT\\DATAMAXST-3210\\6&93D5382&B&USB001";
HardwareID = {"USBPRINT\\DatamaxST-3210A4C7", "DatamaxST-3210A4C7"};
Name = "DatamaxST-3210";
PNPDeviceID = "USBPRINT\\DATAMAXST-3210\\6&93D5382&B&USB001";
Status = "OK";
SystemCreationClassName = "Win32_ComputerSystem";
};
First one have DeviceID with data I use for searching, but not Caption. Second device have correct Caption and no info about his vid\pid.
Using windows device manages I see that my device have Parent with correct vid/pid. I belive that USBPRINT device is a child of USB\VID_...
So, how can I get USBPRINT device name by knowing devices VID\PID?