将下面的内容保存成.vbs文件,然后双击执行,在打开ie页面,在页面中点击右键,看看菜单中多了个什么!!:)
复制代码 代码如下:
optionexplicit
dimhkey_root,hkey_path,hkey_key,filepath
dimfs,fso,regwsh
hkey_root="hkey_current_user"
hkey_path="softwaremicrosoftinternetexplorer"
//先创建文件
setfs=wscript.createobject("scripting.filesystemobject")
filepath="c:pagesetup_default.htm"
setfso=fs.createtextfile(filepath,true)
fso.write("<scriptlanguage=""vbscript"">"+vbcrlf_
+"dimhkey_root,hkey_path,hkey_key,filepath,regwsh"+vbcrlf_
+"hkey_root=""hkey_current_user"""+vbcrlf_
+"hkey_path=""softwaremicrosoftinternetexplorer"""+vbcrlf_
+"filepath=""c:pagesetup_null.htm"""+vbcrlf_
+"//设置网页打印的页眉页脚为默认值"+vbcrlf_
+"setregwsh=createobject(""wscript.shell"")"+vbcrlf_
+"hkey_key=""pagesetupheader"""+vbcrlf_
+"regwsh.regwritehkey_root+hkey_path+hkey_key,""&w&b页码:&p/&p"""+vbcrlf_
+"hkey_key=""pagesetupfooter"""+vbcrlf_
+"regwsh.regwritehkey_root+hkey_path+hkey_key,""&u&b&d"""+vbcrlf_
+"//设置右键菜单上的显示文字"+vbcrlf_
+"//首先删除原来的项,然后再设置新的项"+vbcrlf_
+"onerrorresumenext"+vbcrlf_
+"hkey_key=hkey_root+hkey_path+""menuext打印时恢复页眉页脚"""+vbcrlf_
+"regwsh.regdeletehkey_key"+vbcrlf_
+"hkey_key=hkey_root+hkey_path+""menuext打印时去掉页眉页脚"""+vbcrlf_
+"regwsh.regwritehkey_key,filepath"+vbcrlf_
+"//关闭regwsh"+vbcrlf_
+"setregwsh=nothing"+vbcrlf_
+"</script>")
fso.close
filepath="c:pagesetup_null.htm"
setfso=fs.createtextfile(filepath,true)
fso.write("<scriptlanguage=""vbscript"">"+vbcrlf_
+"dimhkey_root,hkey_path,hkey_key,filepath,regwsh"+vbcrlf_
+"hkey_root=""hkey_current_user"""+vbcrlf_
+"hkey_path=""softwaremicrosoftinternetexplorer"""+vbcrlf_
+"filepath=""c:pagesetup_default.htm"""+vbcrlf_
+"//设置网页打印的页眉页脚为空"+vbcrlf_
+"setregwsh=createobject(""wscript.shell"")"+vbcrlf_
+"hkey_key=""pagesetupheader"""+vbcrlf_
+"regwsh.regwritehkey_root+hkey_path+hkey_key,"""""+vbcrlf_
+"hkey_key=""pagesetupfooter"""+vbcrlf_
+"regwsh.regwritehkey_root+hkey_path+hkey_key,"""""+vbcrlf_
+"//设置右键菜单上的显示文字"+vbcrlf_
+"//首先删除原来的项,然后再设置新的项"+vbcrlf_
+"onerrorresumenext"+vbcrlf_
+"hkey_key=hkey_root+hkey_path+""menuext打印时去掉页眉页脚"""+vbcrlf_
+"regwsh.regdeletehkey_key"+vbcrlf_
+"hkey_key=hkey_root+hkey_path+""menuext打印时恢复页眉页脚"""+vbcrlf_
+"regwsh.regwritehkey_key,filepath"+vbcrlf_
+"//关闭regwsh"+vbcrlf_
+"setregwsh=nothing"+vbcrlf_
+"</script>")
fso.close
setregwsh=wscript.createobject("wscript.shell")
hkey_key=hkey_root+hkey_path+"menuext打印时去掉页眉页脚"
regwsh.regwritehkey_key,"c:pagesetup_null.htm"
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!