SET Command for global environment variables

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
 
M

Mark V

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.
 
H

Helge Wunderlich

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".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top