oReg.CreateKeyHKEY_LOCAL_MACHINE,strKeyPath
oReg.SetExpandedStringValueHKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
oReg.SetStringValueHKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
oReg.SetDWORDValueHKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
oReg.SetBinaryValueHKEY_LOCAL_MACHINE,strPath,strValueName,uBinary
oReg.SetMultiStringValueHKEY_LOCAL_MACHINE,strKeyPath,strValueName,arrStringValues
oReg.DeleteKeyHKEY_LOCAL_MACHINE,strKeyPath
oReg.DeleteValueHKEY_LOCAL_MACHINE,strKeyPath,strStringValueName
oReg.GetExpandedStringValueHKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
oReg.GetDWORDValueHKEY_CURRENT_USER,strKeyPath,strValueName,dwValue
oReg.GetStringValueHKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
oReg.GetBinaryValueHKEY_LOCAL_MACHINE,strKeyPath,strValueName,uBinary
oReg.GetMultiStringValueHKEY_LOCAL_MACHINE,strKeyPath,strValueName,arrStringValues
'-------------------------------------------------------------------------------------------
ConstHKEY_CLASSES_ROOT=&H80000000
ConstHKEY_CURRENT_USER=&H80000001
ConstHKEY_LOCAL_MACHINE=&H80000002
ConstHKEY_USERS=&H80000003
ConstHKEY_CURRENT_CONFIG=&H80000005
'创建注册表项
constHKEY_LOCAL_MACHINE=&H80000002
strComputer="."
SetStdOut=WScript.StdOut
SetoReg=GetObject("winmgmts:{impersonationLevel=impersonate}!"&_
strComputer&"rootdefault:StdRegProv")
strKeyPath="SOFTWARESystemAdminScriptingGuide"
oReg.CreateKeyHKEY_LOCAL_MACHINE,strKeyPath
'创建多字符串值
constHKEY_LOCAL_MACHINE=&H80000002
strComputer="."
SetoReg=GetObject("winmgmts:{impersonationLevel=impersonate}!"&_
strComputer&"rootdefault:StdRegProv")
strKeyPath="SOFTWARESystemAdminScriptingGuide"
strValueName="MultiStringValueName"
arrStringValues=Array("firststring","secondstring",_
"thirdstring","fourthstring")
oReg.SetMultiStringValueHKEY_LOCAL_MACHINE,strKeyPath,_
strValueName,arrStringValues
'创建扩展的字符串值
constHKEY_LOCAL_MACHINE=&H80000002
strComputer="."
SetoReg=GetObject("winmgmts:{impersonationLevel=impersonate}!"&_
strComputer&"rootdefault:StdRegProv")
strKeyPath="SOFTWARESystemAdminScriptingGuide"
strValueName="ExpandedStringValueName"
strValue="%PATHEXT%"
oReg.SetExpandedStringValueHKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
'创建字符串和DWORD值
constHKEY_LOCAL_MACHINE=&H80000002
strComputer="."
SetStdOut=WScript.StdOut
SetoReg=GetObject("winmgmts:{impersonationLevel=impersonate}!"&_
strComputer&"rootdefault:StdRegProv")
strKeyPath="SOFTWARESystemAdminScriptingGuide"
strValueName="StringValueName"
strValue="stringvalue"
oReg.SetStringValueHKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
strValueName="DWORDValueName"
dwValue=82
oReg.SetDWORDValueHKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
'删除注册表项
constHKEY_LOCAL_MACHINE=&H80000002
strComputer="."
SetoReg=GetObject("winmgmts:{impersonationLevel=impersonate}!"&_
strComputer&"rootdefault:StdRegProv")
strKeyPath="SOFTWARESystemAdminScriptingGuide"
oReg.DeleteKeyHKEY_LOCAL_MACHINE,strKeyPath
'删除注册表值
constHKEY_LOCAL_MACHINE=&H80000002
strComputer="."
SetoReg=GetObject("winmgmts:{impersonationLevel=impersonate}!"&_
strComputer&"rootdefault:StdRegProv")
strKeyPath="SOFTWARESystemAdminScriptingGuide"
strDWORDValueName="DWORDValueName"
strExpandedStringValueName="ExpandedStringValueName"
strMultiStringValueName="MultiStringValueName"
strStringValueName="StringValueName"
oReg.DeleteValueHKEY_LOCAL_MACHINE,strKeyPath,strDWORDValueName
oReg.DeleteValueHKEY_LOCAL_MACHINE,strKeyPath,strExpandedStringValueName
oReg.DeleteValueHKEY_LOCAL_MACHINE,strKeyPath,strMultiStringValueName
oReg.DeleteValueHKEY_LOCAL_MACHINE,strKeyPath,strStringValueName
'枚举注册表值和类型
'枚举子项
'列出注册表文件
'监视注册表子项事件
'监视注册表子树事件
'读取二进制注册表值
constHKEY_LOCAL_MACHINE=&H80000002
strComputer="."
SetStdOut=WScript.StdOut
SetoReg=GetObject("winmgmts:{impersonationLevel=impersonate}!"&_
strComputer&"rootdefault:StdRegProv")
strKeyPath="SOFTWAREMicrosoftWindowsNTCurrentVersion"
strValueName="LicenseInfo"
oReg.GetBinaryValueHKEY_LOCAL_MACHINE,strKeyPath,_
strValueName,strValue
Fori=lBound(strValue)touBound(strValue)
StdOut.WriteLinestrValue(i)
Next
当前1/2页12下一页阅读全文