Solved

automate enviornment variable settings

Posted on 2011-03-25
5
262 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 52

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

[Webinar] Disaster Recovery and Cloud Management

Learn from Unigma and CloudBerry industry veterans which providers are best for certain use cases and how to lower cloud costs, how to grow your Managed Services practice in IaaS clouds, and how to utilize public cloud for Disaster Recovery

Question has a verified solution.

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

Both MMF (multi-mode fiber) and SMF (single-mode fiber) are types of optical fiber that can aid in communication applications. These thin strands of silica or glass will allow communication to occur between devices. The transmission of light between…
A quick step-by-step overview of installing and configuring Carbonite Server Backup.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

910 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now