1

This target is OK (D:\Temp\sgr.tar.gz):

  <target name="myTarget" description="Download application delivery file">
    <exec program="pscp.exe">
        <arg line="-batch -v -l ${ftp.user} -pw ${ftp.password} ${ftp.host}:${remote.dir}/${remote.file} D:\Temp\sgr.tar.gz"/>
    </exec>
  </target>

This target (with a space in target directory (D:\tmp 2\sgr.tar.gz)) is KO:

  <target name="myTarget" description="Download application delivery file">
    <exec program="pscp.exe">
        <arg line="-batch -v -l ${ftp.user} -pw ${ftp.password} ${ftp.host}:${remote.dir}/${remote.file} D:\Temp\tmp 2.tar.gz"/>
    </exec>
  </target>

I have this error:

[exec] More than one remote source not supported

I try with but is KO also.

Martin Prikryl
  • 167,268
  • 50
  • 405
  • 846
Stéphane GRILLON
  • 9,914
  • 8
  • 74
  • 125

1 Answers1

2

Wrap the path to double-quotes (&quot):

    <arg line="-batch -v -l ${ftp.user} -pw ${ftp.password} ${ftp.host}:${remote.dir}/${remote.file} &quot;D:\Temp\tmp 2.tar.gz&quot;"/>

See How to escape double quotes in XML attributes values?

Martin Prikryl
  • 167,268
  • 50
  • 405
  • 846