Does anyone know of a jar and task that lets you run
BAT as an ANT task?
When I try these commands with the properties correctly defined,
the bat application starts up and immediately shuts down
without doing any work. (Any suggestions?)
I'm running WinXP.
Thanks.
<target name="do-release">
<exec dir="W:\nk\bbat\run_common"executable="cmd.exe">
<arg value="bat.bat"/>
<arg value="-d"/>
<arg value="build"/>
<arg value="../../bcf_common/pz/bcf.xml"/>
<arg value="${application-name}-label-${pvcs-labe}"/>
</exec>
</target>
<target name="t">
<exec dir="W:\nk\bbat\run_common" os="Windows XP"
executable="cmd.exe" spawn="true">
<arg value="bat.bat"/>
<arg value="-d"/>
<arg value="../../bcf_common/pz/bcf.xml"/>
<arg value="${application-name}-label-${pvcs-label}"/>
</exec>
</target>
Roedy Green - 07 Oct 2005 05:42 GMT
>Does anyone know of a jar and task that lets you run
>BAT as an ANT task?
<exec executable="xxxx.exe" dir="${package.dir}">
Your executable is called something like cmd.exe or 4NT.exe. Your bat
file is a parameter to it.
See http://mindprod.com/jgloss/exec.html
What you want to do is use Java's exec to spawn a command processor
within ANT.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
Roedy Green - 07 Oct 2005 05:44 GMT
><exec dir="W:\nk\bbat\run_common"executable="cmd.exe">
> <arg value="bat.bat"/>
[quoted text clipped - 4 lines]
> </exec>
></target>
Looks like you are missing a space before executable.
Do something must simpler to start then gradually add the complexity.
e.g. bat file just says pause "it worked"

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
Roedy Green - 07 Oct 2005 05:45 GMT
><exec dir="W:\nk\bbat\run_common"
in Ant-land you use platform independent filenames. So get rid of the
W: Everything is relative. and change the \ to /
.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.