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&"\root\default:StdRegProv") strKeyPath="SOFTWARE\SystemAdminScriptingGuide" oReg.CreateKeyHKEY_LOCAL_MACHINE,strKeyPath
''创建多字符串值 constHKEY_LOCAL_MACHINE=&H80000002 strComputer="." SetoReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\"&_ strComputer&"\root\default:StdRegProv") strKeyPath="SOFTWARE\SystemAdminScriptingGuide" 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&"\root\default:StdRegProv") strKeyPath="SOFTWARE\SystemAdminScriptingGuide" 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&"\root\default:StdRegProv") strKeyPath="SOFTWARE\SystemAdminScriptingGuide" 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&"\root\default:StdRegProv") strKeyPath="SOFTWARE\SystemAdminScriptingGuide" oReg.DeleteKeyHKEY_LOCAL_MACHINE,strKeyPath
''删除注 |