日期:2014-05-17  浏览次数:21039 次

如何用VBS访问Windows7注册表
Script: D:\Test\init.vbs
Line: 6
Char: 1
Error: Invalid root in registry key "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet001\Control\Session Manager\Environment\".
Code: 80070005 (Access Denied) 
Source: WshShell.RegWrite
 
----------------------------------
 
myPath = "this is my path"
 
Set WshShell = WScript.CreateObject("WScript.Shell")
RegPath = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\"
WshShell.RegWrite RegPath & "myPath", myPath, "REG_SZ"


------解决方案--------------------
权限不够,被拒绝了
------解决方案--------------------
探讨
怎么办?我是administrators组的