<script language="javascript">var hkey_root,hkey_key;
hkey_root="HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\PageSetup\\";
alert(hkey_root);
//设置页眉页脚为空
function PageSetup_Null(){
try{
var RegWsh = new ActiveXObject("WScript.Shell");
hkey_key1="header";
hkey_key2="footer";
alert('3');
RegWsh.RegWrite(hkey_root+hkey_key1,"");
RegWsh.RegWrite(hkey_root+hkey_key2,"");
alert('1');
}catch(e){}
}
</script>alert(hkey_root)能打印出来,3就怎么也打不出来
hkey_root="HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\PageSetup\\";
alert(hkey_root);
//设置页眉页脚为空
function PageSetup_Null(){
try{
var RegWsh = new ActiveXObject("WScript.Shell");
hkey_key1="header";
hkey_key2="footer";
alert('3');
RegWsh.RegWrite(hkey_root+hkey_key1,"");
RegWsh.RegWrite(hkey_root+hkey_key2,"");
alert('1');
}catch(e){}
}
</script>alert(hkey_root)能打印出来,3就怎么也打不出来
解决方案 »
- 哪位有dhtmlxgrid的专业版共享一下
- javascript获取访问地址
- 有关indexOf()方法的应用问题!
- 请教:我在做一个完全客户端使用的程序,要求全部用js实现,不使用IIS,要求读写xml文件
- 单击checkbox使当前页面中的iframe刷新?
- 如何判断一个字体串中的某一个分隔符的个数,并且规定超过了10个后,就截断前面的,只留下后面的.
- 问一个播放器的问题
- 问个checkbox的问题
- 我想通过一个链接更换整个框架或者其中的几个页面,请问如何实现??
- javaScript脚本执行顺序问题
- JScript中的ActiveX对象都有哪些?
- extjs拖拽问题和grid控件的列头问题。
catch(e){alert(e);}
regsvr32 wshom.ocx
regsvr32 shell32.dll
估计是新建var RegWsh = new ActiveXObject("WScript.Shell"); 对象的时候出错。
修改一下IE的安全设置就可以了