I am tring to enumerate values within a key in the registry. I am getting this error
Type mismatch: 'UBound' on line 12
Below is my code.
Thanks for the help
Const HKEY_LOCAL_MACHINE = &H80000002
Const REG_SZ = 1
strComputer = "."
Set objReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer &
"\root\default:StdRegProv")
strMasterKeyPath = "SYSTEM\ControlSet001\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}"
objReg.EnumKey HKEY_LOCAL_MACHINE, strMasterKeyPath, arrSubKeys
For Each Subkey in arrSubKeys
strKeyPath = "SYSTEM\ControlSet001\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\" & SubKey
objReg.EnumValues HKEY_LOCAL_MACHINE, strKeyPath, arrEntryNames, arrValueTypes
For i=0 To UBound(arrEntryNames)
Select Case arrEntryNames(i)
Case DriverDate
Wscript.echo "Date"
objReg.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath, arrEntryNames(i), strValue
Wscript.echo strValue
Case DriverVersion
Wscript.echo "Version"
objReg.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath, arrEntryNames(i), strValue
Wscript.echo strValue
Case DriverDesc
Wscript.echo "Desc"
objReg.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath, arrEntryNames(i), strValue
Wscript.echo strValue
Case SpeedDuplex
Wscript.echo "Duplex"
objReg.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath, arrEntryNames(i), strValue
Wscript.echo strValue
End Select
Next
Next
Type mismatch: 'UBound' on line 12
Below is my code.
Thanks for the help
Const HKEY_LOCAL_MACHINE = &H80000002
Const REG_SZ = 1
strComputer = "."
Set objReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer &
"\root\default:StdRegProv")
strMasterKeyPath = "SYSTEM\ControlSet001\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}"
objReg.EnumKey HKEY_LOCAL_MACHINE, strMasterKeyPath, arrSubKeys
For Each Subkey in arrSubKeys
strKeyPath = "SYSTEM\ControlSet001\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\" & SubKey
objReg.EnumValues HKEY_LOCAL_MACHINE, strKeyPath, arrEntryNames, arrValueTypes
For i=0 To UBound(arrEntryNames)
Select Case arrEntryNames(i)
Case DriverDate
Wscript.echo "Date"
objReg.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath, arrEntryNames(i), strValue
Wscript.echo strValue
Case DriverVersion
Wscript.echo "Version"
objReg.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath, arrEntryNames(i), strValue
Wscript.echo strValue
Case DriverDesc
Wscript.echo "Desc"
objReg.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath, arrEntryNames(i), strValue
Wscript.echo strValue
Case SpeedDuplex
Wscript.echo "Duplex"
objReg.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath, arrEntryNames(i), strValue
Wscript.echo strValue
End Select
Next
Next