Solved

automate enviornment variable settings

Posted on 2011-03-25
5
279 Views
Last Modified: 2012-08-13
I would like to add a directory path to environment variable path anyone know how I can automate this ?
0
Comment
Question by:shadow2007
5 Comments
 
LVL 47

Expert Comment

by:Donald Stewart
ID: 35215321
0
 

Author Comment

by:shadow2007
ID: 35215359
I am dealing with a very restricted envrionment when it comes to GP therefore I would have to find a different way
0
 
LVL 8

Expert Comment

by:subhashchy
ID: 35215447
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
 

Author Comment

by:shadow2007
ID: 35215701
Set WSHShell = WScript.CreateObject("WScript.Shell")
Set WshEnv = WshShell.Environment("SYSTEM")
WshEnv("Path") = WshEnv("Path") & ";M:\DB\whatever\"

that worked
0
 
LVL 53

Accepted Solution

by:
Bill Prew earned 500 total points
ID: 35217255
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

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You may have a outside contractor who comes in once a week or seasonal to do some work in your office but you only want to give him access to the programs and files he needs and keep privet all other documents and programs, can you do this on a loca…
Learn how ViaSat reduced average response times for IT incidents from 10 minutes to 30 seconds.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question