vbscript 注冊(cè)表腳本書(shū)寫(xiě)
更新時(shí)間:2008年06月15日 20:46:46 作者:
用vbscript實(shí)現(xiàn)的修改注冊(cè)表的腳本,建議大家看看
WScript.Echo "Enabling Kerberos Logging..."
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set StdOut = WScript.StdOut
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
'===============================================================================
'創(chuàng)建項(xiàng)的位置
oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath
'啟動(dòng)創(chuàng)建項(xiàng)目的類型
'=====================================1'REG_SZ 字符串值==========================================
strValueName = "SysExplr"
'創(chuàng)建字符串的名稱
strValue = "d:\\Herosoft\\HeroV8\\SYSEXPLR.EXE"
'創(chuàng)建字符串的數(shù)據(jù)
oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
'所創(chuàng)建的類型字符串
'=====================================2.REG_DWORD DWORD值===========================================
strValueName = "DWORD Value Name"
'創(chuàng)建DWORD名稱
dwValue = 82
'創(chuàng)建DWORD數(shù)據(jù)
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
'所創(chuàng)建類型DWORD
'=======================================3.REG_EXPAND_SZ 可擴(kuò)充字符串值=========================================
strValueName = "Expanded String Value Name"
'創(chuàng)建擴(kuò)充字符串名稱
strValue = "%PATHEXT%"
'字符串?dāng)?shù)據(jù)
oReg.SetExpandedStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
'所創(chuàng)建類型為擴(kuò)充字符串
'========================================4.REG_MULTI_SZ 多字符串值=========================================
strValueName = "Multi String Value Name"
'創(chuàng)建多字符串名稱
arrStringValues = Array("first string", "second string","third string", "fourth string")
'創(chuàng)建多字符串值
oReg.SetMultiStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,arrStringValues
'所創(chuàng)建類型為多字符串值
'======================================================================================
oReg.DeleteKey HKEY_LOCAL_MACHINE, strKeyPath
strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath
WScript.Echo "-=[Complete!]=-"
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set StdOut = WScript.StdOut
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
'===============================================================================
'創(chuàng)建項(xiàng)的位置
oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath
'啟動(dòng)創(chuàng)建項(xiàng)目的類型
'=====================================1'REG_SZ 字符串值==========================================
strValueName = "SysExplr"
'創(chuàng)建字符串的名稱
strValue = "d:\\Herosoft\\HeroV8\\SYSEXPLR.EXE"
'創(chuàng)建字符串的數(shù)據(jù)
oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
'所創(chuàng)建的類型字符串
'=====================================2.REG_DWORD DWORD值===========================================
strValueName = "DWORD Value Name"
'創(chuàng)建DWORD名稱
dwValue = 82
'創(chuàng)建DWORD數(shù)據(jù)
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
'所創(chuàng)建類型DWORD
'=======================================3.REG_EXPAND_SZ 可擴(kuò)充字符串值=========================================
strValueName = "Expanded String Value Name"
'創(chuàng)建擴(kuò)充字符串名稱
strValue = "%PATHEXT%"
'字符串?dāng)?shù)據(jù)
oReg.SetExpandedStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
'所創(chuàng)建類型為擴(kuò)充字符串
'========================================4.REG_MULTI_SZ 多字符串值=========================================
strValueName = "Multi String Value Name"
'創(chuàng)建多字符串名稱
arrStringValues = Array("first string", "second string","third string", "fourth string")
'創(chuàng)建多字符串值
oReg.SetMultiStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,arrStringValues
'所創(chuàng)建類型為多字符串值
'======================================================================================
oReg.DeleteKey HKEY_LOCAL_MACHINE, strKeyPath
strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath
WScript.Echo "-=[Complete!]=-"
相關(guān)文章
vbs實(shí)現(xiàn)的支持拖動(dòng)的txt文本切割器
用vbs實(shí)現(xiàn)的txt文本文件切割器,默認(rèn)為8000個(gè)字符切為一個(gè)文件。支持拖動(dòng)。2008-06-06用VBS實(shí)現(xiàn)的發(fā)送帶Cookie的HTTP請(qǐng)求的代碼
在昨天的《使用正確版本的XMLHTTP》中賣了個(gè)關(guān)子,ServerXMLHTTP的功能比XMLHTTP強(qiáng)大,你現(xiàn)在大概已經(jīng)猜到了吧。沒(méi)錯(cuò),用ServerXMLHTTP可以在HTTP請(qǐng)求頭中加入Cookie,而XMLHTTP不可以2013-01-01VBS 腳本不能運(yùn)行 提示W(wǎng)indows無(wú)法訪問(wèn)指定設(shè)備路徑或文件
Windows無(wú)法訪問(wèn)指定設(shè)備路徑或文件,您可能沒(méi)有合適的權(quán)限訪問(wèn)這個(gè)項(xiàng)目.2009-10-10vbs 調(diào)用中文語(yǔ)音讓你電腦聽(tīng)你的命令的實(shí)現(xiàn)代碼
關(guān)于vbs調(diào)用中文語(yǔ)音讓你電腦聽(tīng)你的命令的實(shí)現(xiàn)代碼,需要的朋友可以參考下。2009-10-10