ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Barry Andrews <titanandr...@earthlink.net>
Subject Re: How to set environment via batch script
Date Wed, 30 Jun 2004 19:14:59 GMT
Thanks Alexey!  But how can you execute the batch file within the <exec> task?  You can't
do a nested <exec> can you? 


thanks,

Barry



-----Original Message-----
From: "Alexey N. Solofnenko" <A.Solofnenko@mdl.com>
Sent: Jun 29, 2004 11:23 PM
To: Ant Users List <user@ant.apache.org>
Subject: Re: How to set environment via batch script

When you start a new process only that process get new environment - it 
is not propagated back into parent process. You need to execute env.bat 
just before ANT or within <exec> task, if the task requires env.bat to run.

- Alexey.

Barry Andrews wrote:

> Hello,
>     I want to be able to invoke a batch script on Windows 2000 that 
> sets up some environment variables. I know that I can use nested <env> 
> elements with <exec>, but I really need to be able to run this script.
>
> <exec executable="cmd.exe">
>     <arg line="/c env.bat"/>
> </exec>
>
> The script does run because I can see the output in the console, but 
> the environment variables are not set when the JVM exits.
>
> Is there a way to do this?
>
>
> many thanks,
>
> Barry
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message