ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Reilly <>
Subject Re: Problem with command arguments
Date Mon, 19 Jan 2004 12:21:48 GMT
Sorry, I did not read the problem correctly.

What you are trying to do is, I think, not possible
using java's Runtime#exec() method - which is
what is used by ant.

The code for windows uses the Windows API function call - CreateProcess()
this has the crazy syntax of taking the command and the command arguments
as one string value and it is up to the command to parse this string 
into arguments.

Java takes the arguments in Runtime#exec() as an array of arguments and 
a string from them. If an argument contains a space, the code (in 
Runtime#exec()) places
double quotes around them.

michelle zaremskas wrote:

>I have an Ant task that I am writing which is invoking a Windows Command Line program.
An example of the string I am attempting to contruct is:
>pcli Put -prd:\pvcs\vm\sampledb aC:\test -o -m "My Description"  -v"My Version label"
bp/chess/server /chess/server/server.bat /chess/server/shutdown.txt
>The problem is I am having is that the command line executable will not allow a "space"
after the -m parameter and it requires double quotes around the value I am passing.  When
I attempt to construct the Command Argument using the ANT API it will either place a space
after the '-m' parameter or it will place double quotes around the string like so:  "-mMy
>Can someone provide me some guidance on how I can correctly construct this string using
the Ant API for my ANT task.
>Do you Yahoo!?
>Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes

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

View raw message