Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Enumerate registry key

Status
Not open for further replies.

pbanacos

IS-IT--Management
Apr 21, 2006
34
US
Hello,

I keep getting a Ubound error message when I run this script. Does anyone see what is wrong? I would appreciate any help


Const HKEY_LOCAL_MACHINE = &H80000002
Const REG_SZ = 1
Const REG_EXPAND_SZ = 2
Const REG_BINARY = 3
Const REG_DWORD = 4
Const REG_MULTI_SZ = 7

strComputer = "."

Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")

strKeyPath = "SYSTEM\CurrentControlSet\Enum\USB"

oReg.EnumValues HKEY_LOCAL_MACHINE, strKeyPath, _
arrValueNames, arrValueTypes

For i=0 To UBound(arrValueNames)
Wscript.Echo "Value Name: " & arrValueNames(i)

Select Case arrValueTypes(i)
Case REG_SZ
Wscript.Echo "Data Type: String"
Wscript.Echo
Case REG_EXPAND_SZ
Wscript.Echo "Data Type: Expanded String"
Wscript.Echo
Case REG_BINARY
Wscript.Echo "Data Type: Binary"
Wscript.Echo
Case REG_DWORD
Wscript.Echo "Data Type: DWORD"
Wscript.Echo
Case REG_MULTI_SZ
Wscript.Echo "Data Type: Multi String"
Wscript.Echo
End Select
Next
 
>I keep getting a Ubound error message when I run this script. Does anyone see what is wrong?
No. The error message is wrong. Is it that you think it is ubound error, or you faithfully copy from the real message?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top