Thursday, 31 January 2013

Reading Registry Value using JavaScript



Root Key Name
Abbreviation
HKEY_CURRENT_USER
HKCU
HKEY_LOCAL_MACHINE
HKLM
HKEY_CLASSES_ROOT
HKCR
HKEY_USERS
HKEY_USERS
HKEY_CURRENT_CONFIG
HKEY_CURRENT_CONFIG

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
    <head>
        <title>Reading Registry Value</title>
        <script type="text/javascript">
            function readValue() {
                var WshShell = new ActiveXObject("WScript.Shell");
                var value = WshShell.RegRead("HKCU\\Software\\Microsoft\\FTP\\Use PASV");
                document.write("Value of Use PASV: " + value);
            }
        </script>
    </head>
    <body onload="javascript: readValue()">

    </body>
</html>

Note: This code works only in Internet Explorer.

3 comments:

  1. Try not to become a man of success, but rather try to become a man of value. See the link below for more info.


    #value
    www.ufgop.org

    ReplyDelete
  2. var WshShell = new ActiveXObject("WScript.Shell")

    Automation server can't create object

    ReplyDelete
  3. Add ip or domain of the application executing this script to Trusted sites

    ReplyDelete