Hello,

Perhaps this helps....
       <exec executable="cmd"
         dir="${VCC_CBU_ICdir_root}">
          <arg line="/c start cmd /c
                     &quot;IC_start.bat&quot;" />
       </exec>

This opens a new window, starts your program in this windows and continues
With the build script.
If you change the 2nd /c to /k the buildscripts stops until your program stops 
and
the windows closes.

BUT: because of the non-existing coupling between the buildscript and the called
program, you cannot use failonerror and stuff like that (shure, you can use it,
but not to monitor/react on the exit code of your program)

The &quot;s are usefull, if you have more complex arg lines.
In your case they are not needed.

Feel free to fiddle around with more or less cmd and start commands....

Ein Gruss von der Saar

--
Sascha Ernst
Dipl. Inform.
Head of Software Quality Management


Telefon: + 49 (0)681 - 302 - 5133
Telefax: + 49 (0)681 - 302 - 5109
E-Mail: sascha.er...@living-e.com
Website: http://www.living-e.com


Living-e AG 
Campus D3 2
66123 Saarbrücken


Vorstand: Guido Polko
Aufsichtsratsvorsitzender: Uwe Feuersenger
Amtsgericht: Mannheim, HRB 111323

Besuchen Sie uns auf dem 10. ÖV-Symposium am 20.08.2009, Stand 14, 
Ruhrfestspielhaus, Recklinghausen.



-----Ursprüngliche Nachricht-----
Von: Scott Stark [mailto:sst...@us.ibm.com] 
Gesendet: Dienstag, 18. August 2009 16:16
An: Ant Users List
Betreff: Re: exec on batch file causes build to hang


David Weintraub wrote:
>
> > Can you run the batch file outside of Ant from the command line without
> the
> > process hanging?
>

I've discovered that running "start IC_start.bat" from the command line
opens the process in a new window and returns control to the executing
window (on Windows XP). So this does what I want. However, when I try and
do this from an Ant task, I get this error:

BUILD FAILED
C:\working\informix\stop_restart.xml:98: Execute failed:
java.io.IOException: CreateProcess: start C:\VCC\IC_start.bat error=2

Any idea what "error=2" means, and how I can fix it?

Here's my task FYI:

      <exec executable="start"
                  failonerror="${failonerror}"
                  failifexecutionfails="${failifexecutionfails}"
                  dir="${VCC_CBU_ICdir_root}">
          <arg value="${VCC_CBU_ICdir_root}${file.separator}IC_start.bat"/>
        </exec>

thanks!

Scott

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

Reply via email to