Using batch file and WinSCP to download files from the FTP server to file server (shared folder)

纵然是瞬间 提交于 2019-12-06 16:27:29
Martin Prikryl

A UNC path cannot be a working directory in Windows.

But you can use it as a target path in the get command:

get *.xls>1D "\\fs01\Reporting\KGP\File History\"

A full command for a batch file will be:

"C:\Program Files (x86)\WinSCP\WinSCP.com" /command ^
    "open ftp://rnandipati:J13@Files8.cyberlynk.net/kgptel/" ^
    "get *.xls>1D ""\\fs01\Reporting\KGP\File History\""" ^
    "rm *.xls<1D" ^
    "exit"

(not that I understand a logic of the get *.xls>1D and rm *.xls<1D)

For a similar question, see Get file from FTP server and copy it to UNC directory.


If you need to authenticate to the file server, see:

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!