Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

abdalrhman

Pass parameter into WinSCP script

Hi,

I have an SSIS Execute Process Task that uses WinSCP to transfer some files. Below are the values of SSIS Execute Process Task:
Executable: C:\Program Files (x86)\WinSCP\WinSCP.exe
Argument: /log=T:\Scripts\ScriptGetFile.log /script=T:\Scripts\ScriptGetFile.txt

The password is masked and is stored in the database. I can store the masked password in a variable in SSIS, but I don't know how to pass it the script file ScriptGetFile.txt, below is my script that is in ScriptGetFile.txt. How do I pass the parameter that has the masked password to the script:
# Connect to SFTP server using a password
open sftp://username:password@111.11.11.111/ -hostkey="ssh-rsa 2048 41:e4:10:c8:....................."                     
 
# Upload and delete file
Put  C:\Extracts\Files\OUT\./*.csv /IN/
# Exit WinSCP
exit