Wednesday, 25 July 2018

Set environment Path Windows 7

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

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...