Topic "Automatiopn of WINSCP with Private Key is not working"

Author Message


Hi Freinds,

I need your help. Kindly review the below code which I had written

@Echo on

log "C:\test\" "C:\Program Files\WinSCP\WinSCP.exe" -user="rest2" -privatekey="C:\Program Files\WinSCP\PuTTY\SFTPKEY\rest.ppk" -hostKey="ssh-rsa 1024 c1:43:fb:34:d9:05:XX:81:d3:XX:15:8a:69:4a:7b:81" "put C:\test\test.txt"

My task is to connect to target server through WINSCP and put a test.txt file onto server.

Issue: When I execute the batch script the first issue is that it is asking for user ID every time . When I provide "rest2" it will open the server session but will never put the file onto target server.

Log file just provides an open blank text file with success in the file name.

Kindly help me as I am new to WINSCP and I need this work to be completed for my project delivery.

Thank you for your help



Please help !!!!!!
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26889
Location: Prague, Czechia
Duplicate post:

You can post new topics in this forum


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!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License