Solved

automate enviornment variable settings

Posted on 2011-03-25
5
251 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:dstewartjr
Comment Utility
0
 

Author Comment

by:shadow2007
Comment Utility
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
Comment Utility
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
Comment Utility
Set WSHShell = WScript.CreateObject("WScript.Shell")
Set WshEnv = WshShell.Environment("SYSTEM")
WshEnv("Path") = WshEnv("Path") & ";M:\DB\whatever\"

that worked
0
 
LVL 51

Accepted Solution

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In this guide, I outline 7 key steps to help technology professionals grow their careers. Whether you have been working in technology for 10 years or for 10 days, follow these steps to help you achieve your career goals and pursue your passions.
How can you create a game plan that lets you focus on special projects instead of running from cubicle to cubicle every day and feeling like you’ve accomplished nothing? Try these strategies for prioritizing your tasks, offloading what you can, and …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

771 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

11 Experts available now in Live!

Get 1:1 Help Now