Topic "winscp.exe command via SSIS"

Author Message
jimbo20814

Guest


Hi, when I execute a WinSCP script from via a winscp.exe command line, it works fine but doing the same via a SSIS (sql server integration services) package returns an error. In the SSIS Execute Process Task Editor I have the below settings:

Executable: C:\Program Files (x86)\WinSCP\WinSCP.exe
Arguments: /script=D:\Success_Factors\SCP_Script\JimScript.txt

Running the package returns the below:
Error: 0xC0029151 at Get files via SFTP, Execute Process Task: In Executing "C:\Program Files (x86)\WinSCP\WinSCP.exe" "/script=D:\Success_Factors\SCP_Script\JimScript.txt" at "C:\Program Files (x86)\WinSCP\", The process exit code was "1" while the expected was "0".
Task failed: Get files via SFTP

The script is the below. I've XXXX the password.
option batch off
option confirm off
open sftp://ecom:XXXX@sftp4.successfactors.com
cd outgoing
get JimTest.txt D:\Success_Factors\From_FTP_Server\
exit

I'm running WinSCP 4.3.5 (build 1463) on Windows 7.

Any ideas?
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
Please read FAQ:
http://winscp.net/eng/docs/faq_scheduler

If that does not help, come back.
_________________
Martin Prikryl
Oliphant

Guest


Suggestion : Check the FailTaskIfReturnCodeIsNotSuccessValue property of the Process in SSIS
Just set this to False. This may get you right through.





jimbo20814 wrote:
Hi, when I execute a WinSCP script from via a winscp.exe command line, it works fine but doing the same via a SSIS (sql server integration services) package returns an error. In the SSIS Execute Process Task Editor I have the below settings:

Executable: C:\Program Files (x86)\WinSCP\WinSCP.exe
Arguments: /script=D:\Success_Factors\SCP_Script\JimScript.txt

Running the package returns the below:
Error: 0xC0029151 at Get files via SFTP, Execute Process Task: In Executing "C:\Program Files (x86)\WinSCP\WinSCP.exe" "/script=D:\Success_Factors\SCP_Script\JimScript.txt" at "C:\Program Files (x86)\WinSCP\", The process exit code was "1" while the expected was "0".
Task failed: Get files via SFTP

The script is the below. I've XXXX the password.
option batch off
option confirm off
open sftp://ecom:XXXX@sftp4.successfactors.com
cd outgoing
get JimTest.txt D:\Success_Factors\From_FTP_Server\
exit

I'm running WinSCP 4.3.5 (build 1463) on Windows 7.

Any ideas?
Pepys

Guest


Hey jimbo20814,

Have you solved your problem and if yes how? This is really getting on my nerves now... I have tried everythhing and probably not the right solution of course...

Any help will be much appreciated Smile

Regards,
Pepys
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
Pepys wrote:
Have you solved your problem and if yes how? This is really getting on my nerves now... I have tried everythhing and probably not the right solution of course...

Your question on stackoverflow.com:
http://stackoverflow.com/questions/21303885/script-file-executes-fine-but-fails-in-ssis-using-winscp
Tom G

Guest


This happened to me too and drove me crazy.

The files that I wanted were in the root directory, meaning that I didn't need (or want) WinSCP to navigate to a new directory, but it was anyway.

By default, WinSCP remembers the last directory used, and if the last directory used was the root directory, it remembers "/" as the directory used. So, the next time you attempt to connect, WinSCP attempts to find the "/" directory, which doesn't exist.

To get around this problem:
> Edit the connection
> Select 'Advanced'
> Select 'Directories' in the Advanced settings
> Deselect ‘Remember last used directory’ and remove the “/” in the Remote directory box.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
It's recommended that you isolate the script run from GUI configuration:
http://winscp.net/eng/docs/scripting#configuration
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License