Retrieving Device Model Name RRS feed

  • Question

  • I am trying to determine if a device is installed on a machine in my C# application and need to be able to read the "Model" that is displayed in "Devices and Printers" like in the example below.

    I've looked in Win32_PnPEntity but do not see a property for "Model" Wher can I find the Model name for the devices listed in "Devices and Printers"?

    Thursday, December 1, 2016 2:16 PM

All replies

  • It seems the Model name displayed in "Devices and Printers" is a property of the device container (thus not readable from SetupDiGetDeviceProperty, which deals with devnodes rather than containers) and originates from the ModelName XML element in the DeviceInfo XML document in the device metadata package. As such, it depends on whether Windows has been able to download the device metadata package or not.

    AFAIK, there is no dedicated public API for reading the model string from the device metadata. You may however be able to read it from the Shell, perhaps with FOLDERID_PrintersFolder and IShellItem2::GetProperty PKEY_Devices_ModelName.

    It may be better to search for a hardware ID or compatible ID or device interface ID, because those do not depend on device metadata packages. However, the hardware ID is likely to change if the manufacturer starts selling a new revision of the device, even if the physical package is identical.

    Friday, December 2, 2016 4:11 PM
  • "model" is not the right unique value to look to determine if a device is installed on your machine. How specific is your search? what specifically are you trying to find? what bigger problem are you trying to solve?

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Friday, December 2, 2016 6:19 PM