automate enviornment variable settings

I would like to add a directory path to environment variable path anyone know how I can automate this ?
shadow2007Asked:
Who is Participating?
 
Bill PrewCommented:
Check out the SETX command available from a DOS command line, or in a BAT file.  It allows setting  system environment variables like PATH permanently, and can even do so on remote systems.  Just do SETX /? at a command prompt to get help on the command or take a look at:

http://technet.microsoft.com/en-us/library/cc755104%28WS.10%29.aspx

~bp
0
 
DonNetwork AdministratorCommented:
0
 
shadow2007Author Commented:
I am dealing with a very restricted envrionment when it comes to GP therefore I would have to find a different way
0
 
subhashchyCommented:
hklm-system-current control set-control-session manager-enviroment-  here u will finf the value path.
using reg.exe command u can append the path
0
 
shadow2007Author Commented:
Set WSHShell = WScript.CreateObject("WScript.Shell")
Set WshEnv = WshShell.Environment("SYSTEM")
WshEnv("Path") = WshEnv("Path") & ";M:\DB\whatever\"

that worked
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.