⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 createwritewmikeys.vbs

📁 Apress - Managing Enterprise Systems With The Windows Script Host Source Code
💻 VBS
字号:
Const WMICONST = "winmgmts:{impersonationLevel=impersonate}!root\default:"
Const HKEY_LOCAL_MACHINE = &H80000002

Dim strPath, nRet, objRegistry, strKeyPath

'set the key path to write the values to.
strKeyPath = "software\test"

'create an instance of the registry provider
Set objRegistry = GetObject(WMICONST & "StdRegProv")

'write a binary value
nRet = objRegistry.CreateKey(HKEY_LOCAL_MACHINE, strKeyPath)

'write a binary value
nRet = objRegistry.SetBinaryValue(HKEY_LOCAL_MACHINE, _
                                strKeyPath, "binary", Array(1, 2, 3, 4))
'write expanded registry string
nRet = objRegistry.SetExpandedStringValue(HKEY_LOCAL_MACHINE, _
                                     strKeyPath, "expanded", "%path%")
'write expanded string
nRet = objRegistry.SetStringValue(HKEY_LOCAL_MACHINE, _
                                          strKeyPath, "string", "heh")
'write multistring value
nRet = objRegistry.SetMultiStringValue(HKEY_LOCAL_MACHINE, strKeyPath, _
                              "multistring", Array("1", "2", "3", "4"))

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -