Trying to add stuff to the system environment Path via batch, vbs or anything really.
This used to work in a .bat, but has stopped:
setx -m path "C:\addtopath;%PATH%"
This used to work in VBS, but has also stopped:
Set WshShell = WScript.CreateObject("WScript.Shell")
Set WshEnv = WshShell.Environment("SYSTEM")
WshEnv("Path") = WshEnv("Path") & ";C:\addtopath"
This keeps saying invalid syntax when I try to modify the registry:
REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SessionManager\Environment" /v Path /t REG_SZ /d "%path%;C:\addtopath" /f
I am really stumped on this one. I need a solution that will always work. I am running it as administrator, but it still not working.
Cheers,
No comments:
Post a Comment