ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antoine Lévy-Lambert <>
Subject Re: launching bat file in new process
Date Tue, 16 Mar 2004 07:20:59 GMT
Tom Elrod wrote:

> Hello.  I am trying to figure out a way to launch a bat file within 
> ant and have it continue on with the ant build.  I have seen a few 
> post regarding this, but none of the suggestions from those posts are 
> working for me.  I am using ant 1.5.4 on Windows.
Hi Tom,

if you can upgrade to ant 1.6.1, you can use the exec task with the 
spawn attribute set to true.

like this :

<exec executable="cmd.exe" fork="true" spawn="true">
       <arg value="/C"/>
       <arg value="mybatch.bat"/>
       <arg value=">NUL"/>
        <arg value="2>&1"/>

Note that I have included a redirection of stderr/stdout to NUL, because 
otherwise your script might die.
The reason being that there is currently no pumping of stdout/stderr for 
spawned scripts.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message