Click here to Skip to main content
16,017,986 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
JavaScript
function readJREValue()

            {

            document.write("<b>Java Runtime Environment properties of your computer : </b>")
            document.write("<br>")
                var WshShell = new ActiveXObject("WScript.Shell");
                var value = WshShell.RegRead("HKLM\\Software\\JavaSoft\\Java Runtime Environment\\BrowserJavaVersion");
                document.write("Your JRE Browser Version Is: " + value);
                        document.write("<br>");


                  var value2 = WshShell.RegRead("HKLM\\Software\\JavaSoft\\Java Runtime Environment\\CurrentVersion");
                document.write("Your JRE CurrnetVersion Is: " + value2);
                        document.write("<br>");

                        var value3 = WshShell.RegRead("HKLM\\Software\\JavaSoft\\Java Runtime Environment\\Java6FamilyVersion");
                document.write("Version OF Java6FamilyVersion Is: " + value3);
                        document.write("<br>");


                var value4 = WshShell.RegRead("HKLM\\Software\\JavaSoft\\Java Runtime Environment\\Java7FamilyVersion");
                document.write("Version OF Java7FamilyVersion Is: " + value4);
                        document.write("<br>");


                var value1 = WshShell.RegRead("HKLM\\Software\\JavaSoft\\Java Runtime Environment\\1.6.0_45\\JavaHome");

                document.write("JRE Installed Path : " + value1);
                        document.write("<br>");
              };

This Code to read the values from registry because i know the sub folder name. But i want to read the value of sub floder(subkey ) values without giving each subkey path in registry.

example :

java runtime environment contain jre 1.6,1.5 in my mechaine but may be in your mechaine you have 1.2,1.4

so i want to read all the JRE version present under java runtime environment.
Posted
Updated 6-Nov-13 20:47pm
v2
Comments
Richard MacCutchan 7-Nov-13 5:39am    
According to the documentation there is no equivalent of the RegEnumKey or RegEnumValue functions of the Windows API.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900