Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Environment Variables

Status
Not open for further replies.

dehat01

Technical User
Mar 10, 2003
6
US
How do I append Environment Variables to a workstation without overwriting the current values?
 
Use this

Dim strmess = "variables:" & vbcrlf
dim objshell
set objshell = createobject("wscript.shell")

dim objvariable
for each objvariable in objshell.environment
strmess = strmess & vbtab & objvariable & vbcrlf
next

wscript.echo strmess
wscript.echo "Done"
 
Hello dehat01,

To make suggestions of any usefulness, you need to provide more info, such as OS, which variable. OS is surprisingly important as I see the treatment of environment variables is still very unsettled. Very different behaviors for win 9x, Me, 2000 etc. Variable : is it a quite standard variable? or some custom variable?

Also, what do mean by append? Append likes append a new path to the path variable? or append a new variable which name is not already used?

regards - tsuji
 
If you are using nt,2000,xp you can use pathman.exe to add to a path or setx.exe to add an environmental variable. These are on the 2000 support tools on the 2000 cd. Use /? to find the syntax
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top