DigDeep Posted August 3, 2016 Share Posted August 3, 2016 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 More sharing options...
jguinch Posted August 3, 2016 Share Posted August 3, 2016 Check if @error is set or not $val = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Plug-in\11.101.2", "JavaHome") If Not @error Then MsgBox(0, "", "JavaHome value exists") Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
DigDeep Posted August 3, 2016 Author Share Posted August 3, 2016 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 More sharing options...
DigDeep Posted August 3, 2016 Author Share Posted August 3, 2016 So, looking at the the snapshot I have attached here, I want to read the ValueName column result showing as: "JavaHome". Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted August 3, 2016 Moderators Share Posted August 3, 2016 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now