Checking for USB barcode scanners

(imported topic written by samuel7791)

Hi,

How can I check for USB barcode scanners that are attached to a PC? Not sure if the make and model can be detected as well?

rdgs,

Samuel

(imported comment written by dgaynor91)

Hi Samuel.

Not sure if this will help. I used this script to report local printers attached to pcs:

selects “PortName from win32_printer” of wmi

Dix

(imported comment written by samuel7791)

I did some more research on where this might be found and it’s only available in the registry. However, as it’s value is different across every pc, how do I scan through a particular tree location for this value?

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB**“LocationInformation”=“Symbol Bar Code Scanner”

Any help would be greatly appreciated…

Thks,

Samuel

(imported comment written by BenKus)

Does this work?

exists values “LocationInformation” whose (it as string = “Symbol Bar Code Scanner”) of keys of keys of key “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB” of registry

Note that this will iterate over a good amount of registry keys so it might be a good idea to raise the evaluation cycle to something like every 12 hours if you put this into a property… although it seems to go pretty fast on my computer…

Ben

(imported comment written by samuel7791)

It works, but it also returns values if those devices are no longer connected. How can I do it such that it only reports if the device is currently connected??? It seems to run pretty fast even over a older machine so I guess performance is not so bad.

rdgs,

Samuel

(imported comment written by BenKus)

I am not sure about the currently connected question… Do you see any registry keys that indicate that the device is currently connected?

Ben