VBScript comparing binary registry key

iam having difficulty in comparing binary registry key. say for below code. the arrValue will return an array of numbers, what i want to do is compare the full set of values in this array to another binary key. e.g. Binaryvalue1= 020153001 if arrValue = Binaryvalue1 <--trying to put this into vbscript....... any help will be appreciated.

Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")
strKeyPath = "SYSTEM\CurrentControlSet\Control\GroupOrderList"
strEntryName = "Base"
objReg.GetBinaryValue HKEY_LOCAL_MACHINE,strKeyPath, _
'' strEntryName,arrValue
sydpoloAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

yehudahaCommented:
change linr 3 to the value you want
i copyed the registry key from your post if you need else change line 7 and 8
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
binary1 = 020153001
 
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ 
strComputer & "\root\default:StdRegProv")
 
strKeyPath = "SYSTEM\CurrentControlSet\Control\GroupOrderList"
strValueName = "Base"
oReg.GetBinaryValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
 
 
For i = lBound(strValue) to uBound(strValue)
    if  strValue(i) = binary1 Then
    WScript.Echo strValue(i) & " = " & binary1
    End If
Next

Open in new window

0
FemSteenkampIT managerCommented:
this will covert to a user display string (same as regedit gives you) and cna be used in normal comparisons

Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = "SYSTEM\CurrentControlSet\Control\GroupOrderList"
strEntryName = "Base"
objReg.GetBinaryValue HKEY_LOCAL_MACHINE,strKeyPath,strEntryName,arrValue


binstring = ""
for each b in arrValue
    if len(b) > 1 then
        binstring = binstring & hex(b)
    else
        'pad byte with leading zero to keep consistent with display in regedit
        binstring = binstring & "0" & hex(b)
    end if
next


wscript.echo "Value:" & binstring
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sydpoloAuthor Commented:
thank you, worked well.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.