久久国产成人av_抖音国产毛片_a片网站免费观看_A片无码播放手机在线观看,色五月在线观看,亚洲精品m在线观看,女人自慰的免费网址,悠悠在线观看精品视频,一级日本片免费的,亚洲精品久,国产精品成人久久久久久久

分享

vbs腳本操作注冊(cè)表 - Windows 腳本技術(shù) - WinOS論壇 微軟Windows平臺(tái)ITPro技術(shù)社區(qū)

 clardemasol 2011-05-20
.VBS腳本,,也就是SCRIPT 腳本文件對(duì)注冊(cè)表進(jìn)行修改,。下面我通過一個(gè)例子自來解釋腳本文件:
Windows Script Host Sample Script

You have a royalty-free right to use, modify, reproduce and distribute

the Sample Application Files (and/or any modified version) in any way

you find useful, provided that you agree that Microsoft has no warranty,

obligations or liability for any Sample Application Files.

------------------------------------------------------------------------


This sample demonstrates how to write/delete entries in the registry.

L_Welcome_MsgBox_Message_Text = "此腳本顯示如何創(chuàng)建和刪除注冊(cè)表項(xiàng)。"

L_Welcome_MsgBox_Title_Text = "Windows Scripting Host 范例"


Call Welcome()

********************************************************************************

*

* Registry related methods.

*



Dim WSHShell

Set WSHShell = WScript.CreateObject("WScript.Shell")



WSHShell.Popup "創(chuàng)建項(xiàng) HKCU\MyRegKey 數(shù)值為 Top level key"

WSHShell.RegWrite "HKCU\MyRegKey\", "Top level key"



WSHShell.Popup "創(chuàng)建項(xiàng) HKCU\MyRegKey\Entry 數(shù)值為 Second level key"

WSHShell.RegWrite "HKCU\MyRegKey\Entry\", "Second level key"



WSHShell.Popup "將數(shù)值項(xiàng) HKCU\MyRegKey\Value 設(shè)為 REG_SZ 1"

WSHShell.RegWrite "HKCU\MyRegKey\Value", 1



WSHShell.Popup "將數(shù)值項(xiàng) HKCU\MyRegKey\Entry 設(shè)為 REG_DWORD 2"

WSHShell.RegWrite "HKCU\MyRegKey\Entry", 2, "REG_DWORD"



WSHShell.Popup "將數(shù)值項(xiàng) HKCU\MyRegKey\Entry\Value1 設(shè)為 REG_BINARY 3"

WSHShell.RegWrite "HKCU\MyRegKey\Entry\Value1", 3, "REG_BINARY"



WSHShell.Popup ot;刪除 HKCU\MyRegKey\Entry\Value1 數(shù)值"

WSHShell.RegDelete "HKCU\MyRegKey\Entry\Value1"



WSHShell.Popup "刪除 HKCU\MyRegKey\Entry 項(xiàng)"

WSHShell.RegDelete "HKCU\MyRegKey\Entry\"



WSHShell.Popup "刪除 HKCU\MyRegKey 項(xiàng)"

WSHShell.RegDelete "HKCU\MyRegKey\"



********************************************************************************

*

* Welcome

*

Sub Welcome()

Dim intDoIt



intDoIt = MsgBox(L_Welcome_MsgBox_Message_Text, _

vbOKCancel + vbInformation, _

L_Welcome_MsgBox_Title_Text )

If intDoIt = vbCancel Then

WScript.Quit

End If

End Sub

1.在上例中,單引號(hào)后面是注釋.

2. L_Welcome_MsgBox_Message_Text = "此腳本顯示如何創(chuàng)建和刪除注冊(cè)表項(xiàng),。"

L_Welcome_MsgBox_Title_Text = "Windows Scripting Host 范例"

這兩句是提示.

3. 用 Set WSHShell = WScript.CreateObject("WScript.Shell"),定義一個(gè)對(duì)象WSHSHELL 為WScript.Shell,



4.WELCOME()是一個(gè)確認(rèn)對(duì)話框.

5. WSHShell.Popup "創(chuàng)建項(xiàng) HKCU\MyRegKey 數(shù)值為 Top level key" 是聲明要修改的注冊(cè)表項(xiàng).

WSHShell.RegWrite "HKCU\MyRegKey\", "Top level key" 在HKCU下面創(chuàng)建MYREGKEY子鍵,讀者也可以根據(jù)自己實(shí)際情況修改鍵名,、指定路徑。

6,、REG_SZ為字符串,要用引號(hào)引起來,REG_DWORD 為0—2147483647之間整數(shù),REG_BINARY與之范圍相同,。

7、需要注意的是,,若結(jié)尾是“\”則創(chuàng)建一個(gè)主鍵(項(xiàng)),,將其默認(rèn)值設(shè)為逗號(hào)后面的值項(xiàng),若結(jié)尾不是“\”,,則在前一個(gè)“\”后面的項(xiàng)中建立所設(shè)立的VALUE,,逗號(hào)后面為其值。

8,、WSHShell.RegDelete與WSHShell.RegWrite大致相同,,只是功能相反。

各位可以將上面文檔復(fù)制,,存為FILENAME.VBS,,然后雙擊即可。

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,,所有內(nèi)容均由用戶發(fā)布,,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式,、誘導(dǎo)購買等信息,,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,,請(qǐng)點(diǎn)擊一鍵舉報(bào),。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多