Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

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

edtguy

Re: Winscp Script for wth passphrase

I have solved this in an SSIS package that needs to transmit a file. In the package, I have created an Execute Process task to run WinSCP. I have created a variable in the package to store the private key's passphrase. As part of the command line arguments, I entered /parameter // {passphrase}
In the session's script file, I have an open statement with the arguments -privatekey={privateKeylocation} -passphrase=%2
It is %2 because it is the second /parameter argument on my command line.
Hope that helps.
knowme

Re: Winscp Script for wth passphrase

I was able to get this to work with the current version (5.7.4), without the need for the -passphrase switch. This is used in a batch script, and the passphrase is passed to winscp using the echo command:
echo yourpassphrase|winscp /command ^
  "option confirm off" ^
  "option transfer binary" ^
  "open sftp://username:password@server.com -privatekey=C:path\privatekey.PPK" ^
  "cd /out" ^
  "get testfile*" ^
  "exit"

Hope this helps,

Matt
martin

Re: Winscp Script for wth passphrase

Please attach a full log file showing the problem (using the latest version of WinSCP).

To generate log file, use /log=path_to_log_file command-line argument. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.
mrashid

Re: Winscp Script for wth passphrase

hi

(using -privatekey and -passphrase switches)
-passphrase switch is not working, I have downloaded 5.7.6
could you provide the sample script , so it will help in automation script
martin

Re: Winscp Script for wth passphrase

You are not supposed to use Pageant for authentication. That's not it's purpose.

Use the private key file explicitly.

Anyway, see https://winscp.net/eng/docs/faq_scheduler
mrashid

Winscp Script for wth passphrase

Hello all
Need urgent help
i need to transfer the file to remote (UNIX) server , authentication is through the PPK with passphrase,
i have pageant running and added the key , and in current session batch file is working,
however when i run as batch file thru scheduler it is not working,and it is executing with the same user added the key pageant, and it is asking key to add it in pageant everytime it is login.

has any body done the automation , if yes please share the ideas at the earliest