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"