Solved

automate enviornment variable settings

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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
Why pager replacement is still an issue OnPage has what some might call a “hate/hate” relationship with pagers. Not much room for love. As we see it, pagers are an antiquated bit of technology. Pagers are dinosaurs which, like most dinosaurs, sho…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

803 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