雷火电竞-中国电竞赛事及体育赛事平台

歡迎來到入門教程網(wǎng)!

vb

當(dāng)前位置:主頁(yè) > 軟件編程 > vb >

利用vbs腳本實(shí)現(xiàn)設(shè)置IE的打印頁(yè)眉頁(yè)腳信息

來源:本站原創(chuàng)|時(shí)間:2020-01-10|欄目:vb|點(diǎn)擊:

將下面的內(nèi)容保存成.vbs文件,然后雙擊執(zhí)行,在打開ie頁(yè)面,在頁(yè)面中點(diǎn)擊右鍵,看看菜單中多了個(gè)什么?。。海?nbsp;


    

復(fù)制代碼 代碼如下:

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" 

    //先創(chuàng)建文件 
    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 _ 
            +"http://設(shè)置網(wǎng)頁(yè)打印的頁(yè)眉頁(yè)腳為默認(rèn)值"+vbcrlf  _ 
            +"set regwsh = createobject(""wscript.shell"")" +vbcrlf _ 
            +"hkey_key=""\pagesetup\header""" +vbcrlf _ 
            +"regwsh.regwrite hkey_root+hkey_path+hkey_key,""&w&b頁(yè)碼:&p/&p""" +vbcrlf _ 
            +"hkey_key=""\pagesetup\footer""" +vbcrlf _ 
            +"regwsh.regwrite hkey_root+hkey_path+hkey_key,""&u&b&d""" +vbcrlf _ 
            +"http://設(shè)置右鍵菜單上的顯示文字" +vbcrlf _ 
            +"http://首先刪除原來的項(xiàng),然后再設(shè)置新的項(xiàng)"+vbcrlf  _ 
            +"on error resume next" +vbcrlf _ 
            +"hkey_key=hkey_root+hkey_path+""\menuext\打印時(shí)恢復(fù)頁(yè)眉頁(yè)腳\""" +vbcrlf _ 
            +"regwsh.regdelete hkey_key" +vbcrlf _ 
            +"hkey_key=hkey_root+hkey_path+""\menuext\打印時(shí)去掉頁(yè)眉頁(yè)腳\""" +vbcrlf _ 
            +"regwsh.regwrite hkey_key,filepath" +vbcrlf _ 
            +"http://關(guān)閉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 _ 
            +"http://設(shè)置網(wǎng)頁(yè)打印的頁(yè)眉頁(yè)腳為空" +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 _ 
            +"http://設(shè)置右鍵菜單上的顯示文字" +vbcrlf _ 
            +"http://首先刪除原來的項(xiàng),然后再設(shè)置新的項(xiàng)" +vbcrlf _ 
            +"on error resume next"+vbcrlf  _ 
            +"hkey_key=hkey_root+hkey_path+""\menuext\打印時(shí)去掉頁(yè)眉頁(yè)腳\""" +vbcrlf _ 
            +"regwsh.regdelete hkey_key"+vbcrlf  _ 
            +"hkey_key=hkey_root+hkey_path+""\menuext\打印時(shí)恢復(fù)頁(yè)眉頁(yè)腳\""" +vbcrlf _ 
            +"regwsh.regwrite hkey_key,filepath" +vbcrlf _ 
            +"http://關(guān)閉regwsh" +vbcrlf _ 
            +"set regwsh=nothing"+vbcrlf  _ 
        +"</script>") 
    fso.close 

    set regwsh=wscript.createobject("wscript.shell") 
    hkey_key=hkey_root+hkey_path+"\menuext\打印時(shí)去掉頁(yè)眉頁(yè)腳\" 
    regwsh.regwrite hkey_key,"c:\pagesetup_null.htm" 

以上信息與文章正文是不可分割的一部分,如果您要轉(zhuǎn)載本文章,請(qǐng)保留以上信息,謝謝! 

上一篇:打開QQ并且讓它自己輸入用戶名和密碼的vbs腳本

欄    目:vb

下一篇:多進(jìn)程的實(shí)現(xiàn)投票的vbs腳本

本文標(biāo)題:利用vbs腳本實(shí)現(xiàn)設(shè)置IE的打印頁(yè)眉頁(yè)腳信息

本文地址:http://www.jygsgssxh.com/a1/vb/7989.html

網(wǎng)頁(yè)制作CMS教程網(wǎng)絡(luò)編程軟件編程腳本語言數(shù)據(jù)庫(kù)服務(wù)器

如果侵犯了您的權(quán)利,請(qǐng)與我們聯(lián)系,我們將在24小時(shí)內(nèi)進(jìn)行處理、任何非本站因素導(dǎo)致的法律后果,本站均不負(fù)任何責(zé)任。

聯(lián)系QQ:835971066 | 郵箱:835971066#qq.com(#換成@)

Copyright © 2002-2020 腳本教程網(wǎng) 版權(quán)所有