1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| Const HKEY_LOCAL_MACHINE = &H80000002
Const REG_SZ = 1
strComputer = "." ' Use . for current machine
hDefKey = HKEY_LOCAL_MACHINE
strKeyPath = "SYSTEM\ControlSet001\Enum\USB\VID_174C&PID_55AA"
Set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
oReg.EnumKey hDefKey, strKeyPath, arrSubKeys
For Each strSubkey In arrSubKeys
strSubKeyPath = strKeyPath & "\" & strSubkey
oReg.EnumValues hDefKey, strSubKeyPath, arrValueNames, arrTypes
For i = LBound(arrValueNames) To UBound(arrValueNames)
strValueName = arrValueNames(i)
Select Case arrTypes(i)
Case REG_SZ
oReg.GetStringValue hDefKey, strSubKeyPath, strValueName, strvalue
If strValueName = "LocationInformation" Then
MsgBox strSubkey & " -> " & strvalue
End If
End Select
Next |
Partager