3

I have a gaming keyboard (Logitech G15) that uses its own software for additional features. Now I am writing a startup batch script that starts that software if the keyboard is connected. It of course can start automatically, but I disabled it as I don't need it starting when I'm not using the keyboard.

I know how to check if the output from devcon hwids * contains some exact text. So I can find the device. But my question is, is there any information in the output that is persistent between reboots and different keyboards.

I saved the output of DevCon to two files, with and without the keyboard connected. Then I compared them with fc. This is one of the differences:

HID\VID_046D&PID_C221&MI_00\8&29AF1682&0&0000
    Name: HID Keyboard Device
    Hardware ID's:
        HID\VID_046D&PID_C221&REV_0170&MI_00
        HID\VID_046D&PID_C221&MI_00
        HID_DEVICE_SYSTEM_KEYBOARD
        HID_DEVICE_UP:0001_U:0006
        HID_DEVICE

There are also about ten more differences, where the devices are "HID compliant devices", "USB input devices" and also some unrelated devices like the integrated USB hub.

Now what I'm asking is that is there any info that identifies another Logitech G15, or at least always identifies mine?

1 Answer 1

3

Plug&Play the hard way, eh? You have my sympathies.

The information exists, and is right there in front of you. The standard hardware ID incorporates the vendor ID and the product ID. In your case:

HID\VID_046D&PID_C221&REV_0170&MI_00

Vendor ID 046D is Logitech Incorporated, and product ID C221 is a G11/G15 keyboard. (For comparison, product ID C223 is a G11/G15 keyboard with a USB hub.) The vendor ID is just the vendor ID assigned by the USB-IF. The product ID is of course determined by Logitech.

You could in theory restrict your Device Console search:

devcon hwids "VID_046D&PID_C221"

Further reading

2
  • Thank you for the great answer, I have not used hardware IDs before so I did not know what to expect. However I'd like to note that my G15 in fact does have a USB hub (2 ports in the back side), but its ID is still C221. Then, there is a USB hub device with the ID C223. Feb 1, 2014 at 17:43
  • Also I will note that I used the devcon hwids "whatever" syntax to filter out the needed results, but I then piped it to find "USB" > NUL. If nothing is found (no such devices) the errorlevel is set to 1. Feb 1, 2014 at 19:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .