DigDeep

Read Registry key "Value Name" Column

5 posts in this topic

Can someone please tell me how to read registry key's "Value Name" column?

I can't use Regread as it will display the Value data of the "Value Name".

I tried with RegEnumKey and RegEnumVal too but it doesn't work.

 

I just want to check if the word "JavaHome" exists

$val = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Plug-in\11.101.2", "JavaHome")
MsgBox(0, "", $val)

 

Share this post


Link to post
Share on other sites



I have set the @error.

If I use it as:

$val = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Plug-in\11.101.2", "JavaHome")
If Not @error Then MsgBox(0, "", "JavaHome value exists")

I will get the msgbox as: JavaHome value exists.

If instead of above, I use it as:

$val = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Plug-in\11.101.2", "JavaHome")
MsgBox(0, "", $val)

it will display the ValueData column results.

 

But I want to display what is written in the the ValueName column.

Share this post


Link to post
Share on other sites

So, looking at the the snapshot I have attached here, I want to read the ValueName column result showing as: "JavaHome".

2016-08-04_1-22-13.jpg

Share this post


Link to post
Share on other sites

Use RegEnumVal to loop through the Values and find the one you want:

Local $sKey, $sSubKey
    $sKey = "HKLM\SOFTWARE\JavaSoft\Java Plug-in\11.25.2"

    For $i = 1 To 50
        $sSubKey = RegEnumVal($sKey, $i)
        If @error Then
            ExitLoop
        Else
            ConsoleWrite($sSubKey & @CRLF)
        EndIf
    Next

 


√-1 2^3 ∑ π, and it was delicious!

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