1

这个目标没问题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>

这个目标(在目标目录 ( D:\tmp 2\sgr.tar.gz) 中有一个空格)是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>

我有这个错误:

[exec] 不支持多个远程源

我尝试过,但也是 KO。

4

1 回答 1

2

将路径换成双引号 ( &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;"/>

请参阅如何在 XML 属性值中转义双引号?

于 2017-07-12T08:19:08.600 回答