winscpt and ssis task

Advertisement

mr4100
Guest

winscpt and ssis task

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?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,442
Location:
Prague, Czechia

Re: winscpt and ssis task

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

Reply with quote

Guest

Re: winscpt and ssis task

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!

Reply with quote

Guest

Re: winscpt and ssis task

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?

?

Reply with quote

joney
Joined:
Posts:
2

SSIS Execute Process Task not working

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?

Reply with quote

Advertisement

HoMi
Guest

Re: SSIS Execute Process Task not working

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 :(

When I'm running the command with scriptfile as agrument at the commandshell I get no errormessage, but it downloads nothing :(

Reply with quote

martin
Site Admin
martin avatar

Re: SSIS Execute Process Task not working

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.

Reply with quote

JRB_BMB
Joined:
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.

Reply with quote

martin
Site Admin
martin avatar

JRB_BMB wrote:

Change your arguments from using /script or /key to -script and -key
I do not think this makes any difference.

Reply with quote

Advertisement

JRB_BMB
Joined:
Posts:
24
Location:
Midlands, UK

martin 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! :P

Reply with quote

trinath89
Joined:
Posts:
8
Location:
NOIDA

Passing parameters to winscp from ssis execute process task

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

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,442
Location:
Prague, Czechia

Re: Passing parameters to winscp from ssis execute process task

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#two_slashes

Also you should better enclose the %1% in double quotes:
put "%1%" /database/
https://winscp.net/eng/docs/scripting#syntax

Reply with quote

Advertisement

nik27184
Guest

SSIS WinSCP integration using Ppk without Password

--file upload
1) Use Execute Process Task in SSIS
2) in Process - Executable call WinSCP.COM (example : C:\SOFTWARES\WinSCP\WinSCP.com)
3) in Arguments called this

-script="E:\SOFTWARES\WinSCP\TEST_Upload.txt" /log=C:\temp\WinSCP_log.txt

--TEST_Upload file below
open UserName@FTPsiteName -privatekey="ppk file path (example : C:\test\Private.ppk")
lcd C:\TEST\
mput *.txt
close
exit

Thank you !
Nik.

Reply with quote

Advertisement

You can post new topics in this forum