From: robert ehteshamzadeh Date: 2003-07-16T15:05:26+09:00 Subject: Re: how to temporaly change enviroment variable When you run a ruby script, ruby is a child process of your shell. On Windows it looks like this: explorer.exe cmd.exe (shell) ruby.exe each exe has it's own environment. It inherits the environment of it's parent, and can change it's own environment but not it's parent's env. so you can change the shell's environment with a shell script ( or batch file ) and you can change the environment of a script while it's running by puts ENV["PATH"] # shows "/old/path" ENV["PATH"] = "/new/path" puts ENV["PATH"] # shows "/new/path" but if you echo the env var after the script has finished, you will still see the old path. If you wish to change the environment of the shell, you must do it with a shell script (batch file). "Jason Creighton" wrote in message news:20030715225659.443b6445.androflux@softhome.net.remove.to.reply... > On Wed, 16 Jul 2003 05:17:11 +0900 > Roman Dolgov wrote: > > > Hi All, > > > > Is there any way to change enviroment variable during > > execution of ruby script inside of the script. > > > > (for ex PATH ) > > > > So when I use `` command > > > > # change PATH somehow > > `run.exe` > > > > run.exe will be picked up from the modified PATH. > > ENV["PATH"] = "/new/path" > > Jason Creighton >