Jump to content

Read Registry key "Value Name" Column


Recommended Posts

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)

 

Link to comment
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.

Link to comment
Share on other sites

  • Moderators

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

 

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...