Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

try to exec multiple commands on windows using <arg line=

Status
Not open for further replies.

damonh78

Programmer
Jul 28, 2005
44
IE
Hi,

I am trying to use the <exec> task to run a perl script on windows. I need to source the environment using a .bat file first so I am running the two commands in the same shell.
The code I am trying to use is the following:
<exec executable="cmd" dir="${DMTA}" failonerror="false">
<arg line='/c "setenvs.bat && ${PERL} DMTA_Driver.pl -v"'/>
</exec>

My problem is with the <arg line=...
When I try to run this it throws the following error because of the &'s:
The entity name must immediately follow the '&' in the entity reference.
I know & is used to import files prior to 1.6 so I take it that ANT is throwing the error because of this. Do I need to escape the &'s? I tried using \'s and using the hexcode for & but to no avail.
Any ideas would be gratefully accepted.

Thanks,

John

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top