SET Command for global environment variables

  • Thread starter Thread starter Andreas Klausing
  • Start date Start date
A

Andreas Klausing

Hi all,

is it possible to set an environment variable from a batch
file an have this variable in the global env. so that is
valid even when the command prompt is closed ?

Regards,
Andreas Klausing
 
In said:
What about google?
http://groups.google.de/groups?as_q=global+set&num=10&as_scoring=r&
hl=de&ie=UTF-8&oe=UTF-8&btnG=Google+Suche&as_epq=&as_oq=&as_eq=&as_
ugroup=microsoft.public.win2000.cmdprompt.admin&as_usubject=&as_uau
thors=&as_umsgid=&lr=&as_drrb=q&as_qdr=&as_miny=1981&as_minm=5&as_m
ind=12&as_maxy=2003&as_maxm=11&as_maxd=28

setx -m from the reskit (w2k reskit not free) w2k3 might work
also. xset from http://xset.tripod.com not free

One might also script it using REG.EXE (free in the Support Tools) by
writing directly to the User or Machine areas of the registry for
environment.
 
is it possible to set an environment variable from a batch
file an have this variable in the global env. so that is
valid even when the command prompt is closed ?

You can do it with a small VBscript:

set oSysEnv = CreateObject("WScript.Shell").Environment("SYSTEM")
oSysEnv("TEST") = "Your value"

The two lines above will set the variable "TEST" to the value "Your
value".
 
Back
Top