Download files from Unix server using WinSCP with get command

眉间皱痕 提交于 2019-11-27 15:54:18

To automate a task using WinSCP, use its scripting interface from a batch file (e.g. download.bat).

I assume you want to use SFTP, as you are connecting to a *nix server.

The simplest download batch file is like:

winscp.com /log=c:\path\to\log\winscp.log /command ^
    "open sftp://username:password@example.com/ -hostkey=""xxx""" ^
    "get /path/to/file.ext c:\path\to\download\to\" ^
    "exit"

Replace the username, password and example.com with the actual connection details. Get the value of -hostkey switch from your GUI session. Use real paths.

Though it's easier to have WinSCP generate the batch file for you.

For details see a guide to automating file transfers from SFTP server using WinSCP.


Once you have the batch file working, schedule the the batch file execution using Windows scheduler.

See a guide to scheduling file transfers from SFTP server.

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