Sign in to follow this  
Followers 0
Rhyono

Registry values

5 posts in this topic

What would keep you from viewing a value (error code -1) and can/how do you get past that problem?

Here's where I'm encountering the problem:

$a = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography", "MachineGuid")
MsgBox(0,'',$a & " " & @error)

Share this post


Link to post
Share on other sites



It failed for me as well, but when I changed it to a 64 bit key, it worked. Are you using a 64bit machine?

$a = RegRead("HKEY_LOCAL_MACHINE64\SOFTWARE\Microsoft\Cryptography", "MachineGuid")
MsgBox(0,'',$a & " " & @error)
1 person likes this

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Yeah, but I viewed other values just fine that way. Which is what causes me to not understand why it works for some but not others. Especially since I used regedit to view it using the path I mentioned.

Your response still allowed for a simple workaround, though. Thanks.

Edited by Rhyono

Share this post


Link to post
Share on other sites

This may work better for you:

If @OSArch = "X86" Then
$kLM = "HKLM"
Else
$kLM = "HKLM64"
EndIf


$a = RegRead( $kLM & "\SOFTWARE\Microsoft\Cryptography", "MachineGuid")
MsgBox(0,'',$a & " " & @error)

Props where props are due:

Share this post


Link to post
Share on other sites

That's what I already ended up doing. Thanks though. :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0