I want to get a unique id of a mouse provided that every mouse brand is the same in a laboratory. I have tried using WMIC to get device attributes. My VBS script is this:
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM Win32_PointingDevice",,48)
Wscript.Echo "DeviceID: " & objItem.DeviceID
I have tried generating this script with different mouse brand and it outputs a unique device id. But when I use the same model/brand of mouse, the same device id is generated. Please help me find a unique data to be used to identify every mouse in a laboratory.
I think Thangadurai is right with his comment do your original question... However, you could try to find desired mouse id running next code snippets.
The simpliest solution with
wmic
:About the same output with
vbScript
: usecscript 28273913.vbs
if saved as28273913.vbs
.More complex than previous
wmic
example providing possibility to run it against more computers in one step. Note thearrComputers = Array(".")
line. Here"."
means This computer and could be rewritten by a list of computer names or IP addresses e.g.