我有一个问题,用vbs脚本写一个新的字符串值到注册表。在regestry编辑器中,我可以将其设为manualy,因此它不是一些权限问题。
我想出了什么。
Set WshShell = CreateObject("WScript.Shell")
myKey = "HKEY_CLASSES_ROOT\Applications\WScript.exe\UserData"
WshShell.RegWrite myKey, some-value,"REG_SZ"
Set WshShell = Nothing
当我尝试运行它时,我收到此错误消息。
注册表项中的root无效" HKEY_CLASSES_ROOT \ Applications \ WScript.exeyUserData"。
代码:800700005
来源:WshShell.RegWrite
我来自这些来源:
launch VBS script after PC startup
https://ss64.com/vb/regwrite.html
感谢您的帮助:)