Topic "winscpt and ssis task"

Author Message
mr4100

Guest


Hi, I can't seem to figure out the command line syntax to run this software with SSIS execute process task.

Here is what I have so far.

I call the WinScp.exe

I pass this line in as my argument

user@mysite.com /privatekey/ "\\test\f$\Import\scp Keys\OSF priv key.ppk"/script="\\sqltest\e$\SSIStest\Export\sftpscript.txt"

it times out everytime?
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
Maybe like this:
user@mysite.com /privatekey="\\test\f$\Import\scp Keys\OSF priv key.ppk" /script="\\sqltest\e$\SSIStest\Export\sftpscript.txt"
_________________
Martin Prikryl
Guest




mr4100 wrote:
Hi, I can't seem to figure out the command line syntax to run this software with SSIS execute process task.

Here is what I have so far.

I call the WinScp.exe

I pass this line in as my argument

user@mysite.com /privatekey/ "\\test\f$\Import\scp Keys\OSF priv key.ppk"/script="\\test\a$\SSIStest\Export\sftpscript.txt"

it times out everytime?


got it!
Guest




mr4100 wrote:
Hi, I can't seem to figure out the command line syntax to run this software with SSIS execute process task.

Here is what I have so far.

I call the WinScp.exe

I pass this line in as my argument

user@mysite.com /privatekey/ "\\test\f$\Import\scp Keys\OSF priv key.ppk"/script="\\sqltest\e$\SSIStest\Export\sftpscript.txt"

it times out everytime?


?
joney
[View user's profile]

Joined: 2008-08-19
Posts: 2
I have the following script that I wrote to a text file called download.txt:

option batch on
# Disable overwrite confirmations
option confirm off

# Do the work
get file*.zip c:\Folder

# Close and exit
close
exit


I am using an SSIS Execute Process Task with the following settings:

RequireFullFileName: True
Executable: C:\Program Files\WinSCP\WinSCP.exe
Arguments: user@ftp.server.com:2222 /privatekey="c:\Folder\PKey.ppk" /script="c:\Folder\download.txt"
WorkingDirectory: c:\Folder

The rest of the settings are default.

When I execute the task, I receive an [Execute Process Task]Progress: Operation Complete - 100 percent complete. However it did not transfer (get) the zip file from the FTP server. What am I doing wrong?
HoMi

Guest


joney wrote:
I have the following script that I wrote to a text file called download.txt:

option batch on
# Disable overwrite confirmations
option confirm off

# Do the work
get file*.zip c:\Folder

# Close and exit
close
exit


I am using an SSIS Execute Process Task with the following settings:

RequireFullFileName: True
Executable: C:\Program Files\WinSCP\WinSCP.exe
Arguments: user@ftp.server.com:2222 /privatekey="c:\Folder\PKey.ppk" /script="c:\Folder\download.txt"
WorkingDirectory: c:\Folder

The rest of the settings are default.

When I execute the task, I receive an [Execute Process Task]Progress: Operation Complete - 100 percent complete. However it did not transfer (get) the zip file from the FTP server. What am I doing wrong?


I have the same problem Sad

When Im running the command with scriptfile as agrument at the commandshell I get no errormessage, but it downloads nothing Sad
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
joney wrote:
When I execute the task, I receive an [Execute Process Task]Progress: Operation Complete - 100 percent complete. However it did not transfer (get) the zip file from the FTP server. What am I doing wrong?

Use /log to enable logging in WinSCP and inspect the log file.
_________________
Martin Prikryl
JRB_BMB
[View user's profile]

Joined: 2008-07-01
Posts: 24
Location: Midlands, UK
Change your arguments from using /script or /key to -script and -key
And call winSCP.COM not the EXE.

Also try to save the connection in winSCP and then open the connection in the script. If you're using a secure server then there shouldn't be an issue with this in terms of security.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
JRB_BMB wrote:
Change your arguments from using /script or /key to -script and -key

I do not think this makes any difference.
_________________
Martin Prikryl
JRB_BMB
[View user's profile]

Joined: 2008-07-01
Posts: 24
Location: Midlands, UK
prikryl wrote:
I do not think this makes any difference.


Well at least this way is tried and tested; so eitherway they can try both and if it doesn't work with '/' then it's an easy change.
I don't know if you have any SSIS experience Martin but it's not exactly a nice experience using it! Razz
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
Also see guide to using WinSCP from SSIS.
trinath89
[View user's profile]

Joined: 2013-01-29
Posts: 8
Location: NOIDA
Hi,

now i know how to send the script file location as an argument
please tell me how to send the parameter with it

-script=D:\script.txt -parameter c:\database\templete.xls

and in the script
option batch off
option confirm off
open XXXXXXXXXXXX
put %1% /database/
exit

will the above code work?

Thanks and Regards
Trinath
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
trinath89 wrote:
-script=D:\script.txt -parameter c:\database\templete.xls

and in the script
option batch off
option confirm off
open XXXXXXXXXXXX
put %1% /database/
exit

will the above code work?

The official syntax is to use slashes:
Though dashes do too.

To make it perfect prepend the parameters with //
/script=D:\script.txt /parameter c:\database\templete.xls
https://winscp.net/eng/docs/commandline#syntax

Also you should better enclose the %1% in double quotes:
put "%1%" /database/
https://winscp.net/eng/docs/scripting#syntax
trinath89
[View user's profile]

Joined: 2013-01-29
Posts: 8
Location: NOIDA
Thanks a lot
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