• 企业400电话
  • 微网小程序
  • AI电话机器人
  • 电商代运营
  • 全 部 栏 目

    企业400电话 网络优化推广 AI电话机器人 呼叫中心 网站建设 商标✡知产 微网小程序 电商运营 彩铃•短信 增值拓展业务
    利用vbs脚本实现设置IE的打印页眉页脚信息
    将下面的内容保存成.vbs文件,然后双击执行,在打开ie页面,在页面中点击右键,看看菜单中多了个什么!!:) 


        
    复制代码 代码如下:

    option explicit 

        dim hkey_root,hkey_path,hkey_key,filepath 
        dim fs,fso,regwsh 

        hkey_root="hkey_current_user" 
        hkey_path="\software\microsoft\internet explorer" 

        //先创建文件 
        set fs=wscript.createobject("scripting.filesystemobject") 
        filepath="c:\pagesetup_default.htm" 
        set fso=fs.createtextfile(filepath,true) 
        fso.write("script language=""vbscript"">"+vbcrlf _ 
                +"dim hkey_root,hkey_path,hkey_key,filepath,regwsh" +vbcrlf _ 
                +"hkey_root=""hkey_current_user""" +vbcrlf _ 
                +"hkey_path=""\software\microsoft\internet explorer""" +vbcrlf _ 
                +"filepath=""c:\pagesetup_null.htm""" +vbcrlf _ 
                +"//设置网页打印的页眉页脚为默认值"+vbcrlf  _ 
                +"set regwsh = createobject(""wscript.shell"")" +vbcrlf _ 
                +"hkey_key=""\pagesetup\header""" +vbcrlf _ 
                +"regwsh.regwrite hkey_root+hkey_path+hkey_key,""wb页码:p/p""" +vbcrlf _ 
                +"hkey_key=""\pagesetup\footer""" +vbcrlf _ 
                +"regwsh.regwrite hkey_root+hkey_path+hkey_key,""ubd""" +vbcrlf _ 
                +"//设置右键菜单上的显示文字" +vbcrlf _ 
                +"//首先删除原来的项,然后再设置新的项"+vbcrlf  _ 
                +"on error resume next" +vbcrlf _ 
                +"hkey_key=hkey_root+hkey_path+""\menuext\打印时恢复页眉页脚\""" +vbcrlf _ 
                +"regwsh.regdelete hkey_key" +vbcrlf _ 
                +"hkey_key=hkey_root+hkey_path+""\menuext\打印时去掉页眉页脚\""" +vbcrlf _ 
                +"regwsh.regwrite hkey_key,filepath" +vbcrlf _ 
                +"//关闭regwsh" +vbcrlf _ 
                +"set regwsh=nothing"+vbcrlf  _ 
            +"/script>") 
        fso.close 

        filepath="c:\pagesetup_null.htm" 
        set fso=fs.createtextfile(filepath,true) 
        fso.write("script language=""vbscript"">" +vbcrlf _ 
                +"dim hkey_root,hkey_path,hkey_key,filepath,regwsh" +vbcrlf _ 
                +"hkey_root=""hkey_current_user""" +vbcrlf _ 
                +"hkey_path=""\software\microsoft\internet explorer""" +vbcrlf _ 
                +"filepath=""c:\pagesetup_default.htm""" +vbcrlf _ 
                +"//设置网页打印的页眉页脚为空" +vbcrlf _ 
                +"set regwsh =createobject(""wscript.shell"")" +vbcrlf _ 
                +"hkey_key=""\pagesetup\header""" +vbcrlf _ 
                +"regwsh.regwrite hkey_root+hkey_path+hkey_key,""""" +vbcrlf _ 
                +"hkey_key=""\pagesetup\footer""" +vbcrlf _ 
                +"regwsh.regwrite hkey_root+hkey_path+hkey_key,""""" +vbcrlf _ 
                +"//设置右键菜单上的显示文字" +vbcrlf _ 
                +"//首先删除原来的项,然后再设置新的项" +vbcrlf _ 
                +"on error resume next"+vbcrlf  _ 
                +"hkey_key=hkey_root+hkey_path+""\menuext\打印时去掉页眉页脚\""" +vbcrlf _ 
                +"regwsh.regdelete hkey_key"+vbcrlf  _ 
                +"hkey_key=hkey_root+hkey_path+""\menuext\打印时恢复页眉页脚\""" +vbcrlf _ 
                +"regwsh.regwrite hkey_key,filepath" +vbcrlf _ 
                +"//关闭regwsh" +vbcrlf _ 
                +"set regwsh=nothing"+vbcrlf  _ 
            +"/script>") 
        fso.close 

        set regwsh=wscript.createobject("wscript.shell") 
        hkey_key=hkey_root+hkey_path+"\menuext\打印时去掉页眉页脚\" 
        regwsh.regwrite hkey_key,"c:\pagesetup_null.htm" 

    以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢! 
    您可能感兴趣的文章:
    • 添加网站到安全站点.设置安全站点打开ActiveX时提示.去页眉页脚的vbs代码
    • IE浏览器打印的页眉页脚设置解决方法
    • js实现页面打印功能实例代码(附去页眉页脚功能代码)
    • JS调用打印方法设置页眉页脚的实例
    • javascript仿php的print_r函数输出json数据
    • javascript实现window.print()去除页眉页脚
    上一篇:用vbs将名称截断以使其最多包含 16 个字符的代码
    下一篇:两个vbs脚本利用了wscirpt.network
  • 相关文章
  • 

    © 2016-2020 巨人网络通讯 版权所有

    《增值电信业务经营许可证》 苏ICP备15040257号-8

    利用vbs脚本实现设置IE的打印页眉页脚信息 利用,vbs,脚本,实现,设置,