ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rohit P <rohitmp....@gmail.com>
Subject Setting Property to a path containing Space
Date Thu, 22 Oct 2009 11:27:26 GMT
Hi,

I have a requirement to execute a program that uses a path as an argument.
The path argument is set using <property> task.

    <property name="SpaceVar" value="C:/Program Files"/>

    <target name="EchoVar">
           <echo> SpaceVar = ${SpaceVar} </echo>
           <exec dir="${basedir}" executable="cmd.exe" failonerror="true">
               <arg line="/c dir ${SpaceVar}"/>
           </exec>

    </target>

After execution of the above snippet i am getting the below error:

E:\Scripts>ant -f SpaceVar.xml
Buildfile: SpaceVar.xml

EchoVar:
     [echo]  SpaceVar = C:/Program Files
     [exec] Parameter format not correct - "Program".

BUILD FAILED
E:\Scripts\SpaceVar.xml:7: exec returned: 1

I am not sure of exactly setting the property SpaceVar to include double
quotes.
Can anybody help me achieve successful execution for the above snippet?

Thanks for your effort.

Thanks
Rohit

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message