如何在Windows下通过FTP下载文件(从Linux到Windows)后运行批处理文件

时间:2016-07-01 09:54:33

标签: windows batch-file ftp

我正在通过FTP从Linux到Windows共享进行文件复制。

复制完成后,我将其移至isilon存储,该存储在网络路径上共享(手动)。

现在我已经创建了一个批处理文件,它将从FTP共享路径复制到网络路径。

那么如何在FTP下载后启动批处理文件?我怎样才能完全自动化?

来自Linux的

ftp -n ip
user "user" "pwd"
put app.tar.gz

一旦完成,我想移动它的网络共享路径

1 个答案:

答案 0 :(得分:0)

copy完成后,只需在批处理文件中使用ftp.exe命令:

ftp.exe -s:download.txt
copy c:\dowloadtarget\myfile.txt \\server\share\target\myfile.txt

如果由于某种原因需要,您甚至可以从FTP脚本(download.txt)运行副本。使用!(转到shell)命令。

get /remote/path/myfile.txt c:\dowloadtarget\myfile.txt
! copy c:\dowloadtarget\myfile.txt \\server\share\target\myfile.txt

但为什么不直接将文件下载到共享文件夹?

get /remote/path/myfile.txt \\server\share\target\myfile.txt