最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

VBS腳本使用WMI操作注冊表的代碼

 更新時(shí)間:2008年06月23日 20:31:29   作者:  
VBS腳本使用WMI操作注冊表,從微軟弄下來的,整理了一下,弄成最簡版,簡版,常用版,以便與快速查找

'讀取 MultiString 值   
const HKEY_LOCAL_MACHINE = &H80000002   
strComputer = "."  
Set StdOut = WScript.StdOut   
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_    
strComputer & "\root\default:StdRegProv")   
strKeyPath = "SYSTEM\CurrentControlSet\Services\Eventlog\System"  
strValueName = "Sources"  
oReg.GetMultiStringValue HKEY_LOCAL_MACHINE,strKeyPath,_   
strValueName,arrValues   
For Each strValue In arrValues   
    StdOut.WriteLine  strValue   
Next  

  

'讀取擴(kuò)展的字符串值   
const HKEY_LOCAL_MACHINE = &H80000002   
strComputer = "."  
Set StdOut = WScript.StdOut   
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_    
strComputer & "\root\default:StdRegProv")   
strKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon"  
strValueName = "UIHost"  
oReg.GetExpandedStringValue HKEY_LOCAL_MACHINE,strKeyPath,_   
strValueName,strValue   
StdOut.WriteLine  "The Windows logon UI host is: " & strValue   

  

'讀取字符串和 DWORD 值   

const HKEY_CURRENT_USER = &H80000001   
const HKEY_LOCAL_MACHINE = &H80000002   
strComputer = "."  
Set StdOut = WScript.StdOut   
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_   
 strComputer & "\root\default:StdRegProv")   
strKeyPath = "Console"  
strValueName = "HistoryBufferSize"  
oReg.GetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue   
StdOut.WriteLine "Current History Buffer Size: " & dwValue    
strKeyPath = "SOFTWARE\Microsoft\Windows Script Host\Settings"  
strValueName = "TrustPolicy"  
oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue   
StdOut.WriteLine "Current WSH Trust Policy Value: " & strValue   

'-------------------------------------------------------------------------------------------   

Const HKEY_CLASSES_ROOT = &H80000000   
Const HKEY_CURRENT_USER = &H80000001   
Const HKEY_LOCAL_MACHINE = &H80000002   
Const HKEY_USERS = &H80000003   
Const HKEY_CURRENT_CONFIG = &H80000005   

strComputer = "."  
Set StdOut = WScript.StdOut   
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")   

  

'創(chuàng)建注冊表項(xiàng)   
strKeyPath = "SOFTWARE\System Admin Scripting Guide"  
oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath   

'創(chuàng)建多字符串值   

strValueName = "Multi String Value Name"  
arrStringValues = Array("first string", "second string", "third string", "fourth string")   
oReg.SetMultiStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,arrStringValues   

'創(chuàng)建擴(kuò)展的字符串值   
strValueName = "Expanded String Value Name"  
strValue = "%PATHEXT%"  
oReg.SetExpandedStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue   

'創(chuàng)建字符串   
strValueName = "String Value Name"  
strValue = "string value"  
oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue   

'創(chuàng)建DWORD 值   
strValueName = "DWORD Value Name"  
dwValue = 82   
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue   

'創(chuàng)建二進(jìn)制值   
strValueName = "Binary Value Name"  
uBinary = Array(1,0,0,0)   
oReg.SetBinaryValue HKEY_LOCAL_MACHINE,strPath,strValueName,uBinary   

  
'刪除注冊表項(xiàng)   
strKeyPath = "SOFTWARE\System Admin Scripting Guide"  
oReg.DeleteKey HKEY_LOCAL_MACHINE, strKeyPath   

  
'刪除注冊表值   

strDWORDValueName = "DWORD Value Name"  
strExpandedStringValueName = "Expanded String Value Name"  
strMultiStringValueName = "Multi String Value Name"  
strStringValueName = "String Value Name"  
oReg.DeleteValue HKEY_LOCAL_MACHINE,strKeyPath,strDWORDValueName   
oReg.DeleteValue HKEY_LOCAL_MACHINE,strKeyPath,strExpandedStringValueName   
oReg.DeleteValue HKEY_LOCAL_MACHINE,strKeyPath,strMultiStringValueName   
oReg.DeleteValue HKEY_LOCAL_MACHINE,strKeyPath,strStringValueName   

  
'''''''''''''''''''''''''''''''''''''''''''''''''枚舉注冊表值和類型   
'''''''''''''''''''''''''''''''''''''''''''''''''枚舉子項(xiàng)   
'''''''''''''''''''''''''''''''''''''''''''''''''列出注冊表文件   
'''''''''''''''''''''''''''''''''''''''''''''''''監(jiān)視注冊表子項(xiàng)事件   
'''''''''''''''''''''''''''''''''''''''''''''''''監(jiān)視注冊表子樹事件   

'讀取 MultiString 值   
strKeyPath = "SYSTEM\CurrentControlSet\Services\Eventlog\System"  
strValueName = "Sources"  
oReg.GetMultiStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,arrValues   
For Each strValue In arrValues   
    StdOut.WriteLine  strValue   
Next  

'讀取擴(kuò)展的字符串值   
strKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon"  
strValueName = "UIHost"  
oReg.GetExpandedStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue   
StdOut.WriteLine  "The Windows logon UI host is: " & strValue   

'讀取字符串值   
strKeyPath = "Console"  
strValueName = "HistoryBufferSize"  
oReg.GetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue   
StdOut.WriteLine "Current History Buffer Size: " & dwValue    

'讀取 DWORD 值   
strKeyPath = "SOFTWARE\Microsoft\Windows Script Host\Settings"  
strValueName = "TrustPolicy"  
oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue   
StdOut.WriteLine "Current WSH Trust Policy Value: " & strValue   

'讀取二進(jìn)制注冊表值   
strKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion"  
strValueName = "LicenseInfo"  
oReg.GetBinaryValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue   
For i = lBound(strValue) to uBound(strValue)   
    StdOut.WriteLine  strValue(i)   
Next 

相關(guān)文章

最新評論

肇东市| 宁波市| 新闻| 石门县| 永靖县| 凤庆县| 金平| 寻乌县| 金乡县| 吐鲁番市| 怀集县| 新龙县| 湖南省| 辽源市| 丰台区| 安塞县| 天全县| 绩溪县| 锡林浩特市| 札达县| 浏阳市| 青海省| 阳山县| 高平市| 西平县| 崇仁县| 庄浪县| 蓬莱市| 哈巴河县| 衡山县| 普兰县| 临汾市| 开封县| 合作市| 邮箱| 安乡县| 丹巴县| 甘泉县| 大理市| 灵石县| 尚义县|