I want to run two dos commands from Ant exec task.
I have tried below code
<exec dir="${testworkspace}\${moduleName}" executable="cmd" failonerror="true" output="${testworkspace}\${moduleName}\BuildConsole_TC${tc_num}.log" resultproperty="execrc">
<arg value="/c echo Download Status is ${DownloadStatus}"/>
<arg value="/c Load.bat ${moduleName} ${Intapp} ${CcvStatus}"/>
</exec>
but it executes only first command and skips second. I am trying this on windows OS.
This should work. Simply chaining the commands.
Why do you need to run two commands in a single
<exec>
task? Instead, just use a second<exec>
task. You can include both in a single target:Or better yet, just use the
<echo>
task:If you need the output of the
echo
task in the same file, you can use thefile
parameter in theecho
command, and theappend
parameter in theexec
task.