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

klee@selco.org

Thanks!
martin

That works too. But it's not recommended syntax.

Only now I have noticed that you have more problems in your original syntax. So my previous post was not enough. The -privatekey and -passphrase should go to the open command, not put. And the quotes for -privatekey should be double too (or removed as they are not needed).
winscp.com /command "open sftp://username:""@site:22/ -privatekey=""E:\Key\SSH_Key.ppk"" -passphrase=""the passphrase""" "get /outgoing/file.pgp C:\TEMP\file.pgp"  "exit"
klee@selco.org

Thanks, I actually got this working with the following:
winscp.exe SITENAME /passphrase="The passphrase" /command "get /RemoteFile.txt.pgp LocalPath.txt.pgp" "exit"
klee@selco.org

Using Passphrase in Command Line

I have a 3rd party vendor I'm trying to connect to via WinSCP, and I'll need to automate the process so I'm trying to figure out how to connect to this vendor using their Private key which requires a passphrase. I'm on version 6.3.7. I have able to connect to their SFTP site with the WinSCP GUI when I key in the passphrase, but I'm not having much luck through command line. Here's what I have now:
winscp.com /command "open sftp://username:""@site:22/" "get /outgoing/file.pgp C:\TEMP\file.pgp" -privatekey="E:\Key\SSH_Key.ppk" passphrase=""the passphrase""  "exit"