title: Script file executes fine but fails in SSIS, using WinSCP
body: <p>I am using (or trying to) <strong>WinSCP</strong> to communicate with a public SFTP server for downloading different data. The perfect scenario would be that I download the most recent file from the SFTP using SSIS but I cannot get the example from winscp.net which uses WindowsPowershell to run. </p>
  
  <p>So another solution would be to run a simple script which downloads <strong>all</strong> zip files. Here is what I have and this works alone when executed (<code>.bat</code> file):</p>
  
  <blockquote>
    <p><code>winscp.exe /console /command "option batch abort" "option confirm off" "open sftp://myUserName@exampleSFTP.com" "get *.zip c:\" "exit"</code></p>
  </blockquote>
  
  <p>When I try to do the same in SSIS within the Execute Process Task, it fails with the very informative error:</p>
  
  <blockquote>
    <p>The process exit code was "1" while the expected was "0"</p>
  </blockquote>
  
  <p>I've tried everything (I guess) from WinSCP.net documentation but nothing worked. Also specified the hostkey in the <code>open</code> command but same failure. </p>
  
  <p>Here is a screenshot of the Execute Process task Editor:
  <img src="https://i.stack.imgur.com/xZDZN.png" alt="enter image description here"></p>