非要批处理的话可以这样- rem 另存为 ANSI 编码
- ' & cls & cscript.exe /nologo /e:vbscript "%~f0" %* & pause & exit /b
-
- Dim oWshShell, oREG, s
-
- Const HKCU = &H80000001
-
- Set oWshShell = CreateObject("WScript.Shell")
- Set oREG = GetObject("Winmgmts:\\.\Root\Default:StdRegProv")
- oWshShell.RegWrite "HKCU\SOFTWARE\test\", "", "REG_SZ"
-
- With CreateObject("Msxml2.DOMDocument").CreateElement("binary")
- .DataType = "bin.hex"
- .Text = "320A31DF37350038" '16进制字节值
- s = .NodeTypedValue
- End With
- oREG.SetBinaryValue HKCU, "SOFTWARE\test", "e", s
复制代码
|