『楼 主』:
[VBS] 如何创建注册表多字符串值?
注册表 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet 下共有4个项,分别是:
Control
Enum
Hardware Profiles
Services
我现在想在Enum下新建一个多字符串的值,结果是失败的:
const HKEY_LOCAL_MACHINE = &H80000002
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & "." & "\root\default:StdRegProv")
strKeyPath = "SYSTEM\CurrentControlSet\Enum"
strValueName = "Multi String Value Name"
arrStringValues = Array("first string", "second string", "third string", "fourth string")
oReg.SetMultiStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,arrStringValues 但是在 Control 下却获得成功,为何?
const HKEY_LOCAL_MACHINE = &H80000002
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & "." & "\root\default:StdRegProv")
strKeyPath = "SYSTEM\CurrentControlSet\Control"
strValueName = "Multi String Value Name"
arrStringValues = Array("first string", "second string", "third string", "fourth string")
oReg.SetMultiStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,arrStringValues
|