Search code examples
ssissftpwinscp

SFTP transfer using Execute Process Task and WinSCP in SSIS


I am having a User_file.txt file placed at WinSCP root folder USERDATA, which I am trying to download to the given location C:\User\Local\.

Executable- C:\Program Files (x86)\WinSCP\WinSCP.exe
Arguments - /log=c:\path\to\log\winscp.log /command "open ftp://username:[email protected]/" "get /USERDATA/User_file.txt C:\User\Local\" "exit"

I am facing below error:

No connection could be made the target machine actively refused it

Not sure what I am missing. I took reference from couple of related post on Stack Overflow.


Solution

  • You want to use SFTP, but use FTP (ftp://) protocol in the session URL.

    Use sftp:// instead:

    ... "open sftp://username:[email protected]/" ...
    

    WinSCP GUI can generate a correct script/command-line template for you.