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

vvk1986

Automatiopn of WINSCP with Private Key is not working

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" testsecure.testcloud.com:22 -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

Vinay
live4vinay@gmail.com