Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8921099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:27:05+00:00 2026-06-15T06:27:05+00:00

The following ANT exec tag does not behave as expected. <exec executable=c:\scratch\test.cmd> <arg value=A,B,C/>

  • 0

The following ANT exec tag does not behave as expected.

<exec executable="c:\scratch\test.cmd">
    <arg value="A,B,C"/>
</exec>

When executed, I would expect this to call text.cmd with 1 argument. However, the arg is being expanded to three separate arguments.

As per the Manual, value is supposed to pass the contents as a single argument, however, it is passed as three (one for each component of the string separated by a comma).

I tried replacing the command “,” with a semicolon (;) but this does not work either. It appears as if arg’s value attribute parses the supplied string as if it were a path, which it is not.

Anyone know how to the “A,B,C” to pass as one argument?

For the sake of completeness, my test.cmd file is this:

@echo off
echo Arg1: %1
echo Arg2: %2
echo Arg3: %3
echo Arg4: %4
echo Arg5: %5
echo Arg6: %6
echo Arg7: %7
echo Arg8: %8
echo Arg9: %9

and the output of the ant build is:

 [exec] Arg1: A
 [exec] Arg2: B
 [exec] Arg3: C
 [exec] Arg4:
 [exec] Arg5:
 [exec] Arg6:
 [exec] Arg7:
 [exec] Arg8:
 [exec] Arg9:
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T06:27:06+00:00Added an answer on June 15, 2026 at 6:27 am

    Issue has been resolved. I was so focused on the issue being in ant, that I didn’t take the time to test how DOS like command lines interpret the command-line arguments.

    from Window command line, I ran test.cmd a,c,b and see that the command argument was split, therefore, the issue is not related to ant. so now I just need to figure out how to force ANT to quote the arguments.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

<exec dir=. executable=osc failonerror=true failifexecutionfails=true> <arg line=-A ${obs.apiurl}/> </exec> Ant executes the following osc
Given the following ant task: <apply executable=${mstest} addsourcefile=false> <arg value=/resultsfile:TestResults.trx /> <arg value=/testsettings:ReleaseCodeCoverage.testsettings />
I have the following ant task: <target name=test> <replace file=test.txt token=smth value=anything/> </target> test.txt
Can not run following SQL from ant's sql task : BEGIN DBMS_AQADM.CREATE_QUEUE_TABLE( queue_table =>
Use 'ant clean test' with the newest android sdk got error: build.xml:622: The following
I have the following ant file that is not running the targets prepForDeployment and
I have the following snippet in my Ant script. It executes just fine: <exec
I have the following ant target: <delete> <fileset dir=${qnaire_dir} includes=**/*~ /> </delete> It does
I tried the following in ant: <?xml version=1.0?> <project name=test default=real basedir=.> <target name=task>
Here is a property file: test.url=https:\\url:port test.path=/home/folder test.location=Location test.version=1 And the following ant task:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.