Topic "Unable to set password for the sftp site"

Author Message
rahul.kolhe22
[View user's profile]

Joined: 2015-10-23
Posts: 3
Hi,

I am trying to create a bat file that can invoke WinSCP to download and upload the file on SFTP site.

Below is my code

SFTP_Code.txt
Code:

option batch abort
option confirm off
option transfer binary
open sftp://USER:Pass1234@example.com -privatekey=C:\temp\SFTP\Auth.ppk
get /home/SVC_CNOVA/in/test.txt
exit


Batch file code: Auto_Batch.bat
Code:

winscp /script=C:\temp\SFTP\SFTP_Code.txt


When I try to execute the batch file from the command prompt it prompts me to enter the password. I enter the same password I gave in the open command marked in bold above.

Can you please suggest me something.

Thank you.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
I assume (as you are using a private key), that the Pass1234 is not a password, but a passphrase.

The passphrase is specified using -passphrase switch:

open sftp://USER@example.com -privatekey=C:\temp\SFTP\Auth.ppk -passphrase="Pass1234"

See http://winscp.net/eng/docs/scriptcommand_open
Guest




Hi,

Thanks a lot!!! it worked for me.

Kind Regards. Very Happy
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