<html>
<head>
<title></title>
<script type="text/javascript">
    function reg () {
        try {
            var shell = new ActiveXObject("WScript.Shell");

            //读注册表值
            var key1 = shell.RegRead("HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\PageSetup\\header");
            alert(key1);
            //删除注册表项 
            shell.RegDelete("HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\\eip");

            //往注册表中写入值
            shell.RegWrite
("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\\eip",
                "C:\\eip\\eip.lnk", "REG_SZ");
            shell.RegWrite("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\\eip",
    "c:\\eip\\eip.lnk", "REG_SZ");
        }
        catch (e) { throw e; }
       
    }
</script>
</head>
<body>
<input  type="button" value="点我" onclick="reg()"/>
</body>
</html>

 

posted on 2015-06-09 20:13  热得快27  阅读(348)  评论(0)    收藏  举报