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.

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)


Topic review


Re: SFTP connection not working when we use script option

It's not because of the script, but because you used the /ini=nul switch, which forces you to specify the host key in the open command.
Dhanasekara pandian

SFTP connection not working when we use script option


I am using WINSCP 5.13 and Windows 10.

I tried to connect SFTP in command prompt like following. "open sftp://****@**.***.**.** -privatekey="W:\Private.ppk" -passphrase=****" after getting in to WINSCP. It is working fine.

I tried the same using a script file like """C:\Program Files (x86)\WinSCP\WinSCP.exe" /ini=nul /script="W:\SendFileCommands.txt".

File has the following script "open sftp://****@**.***.**.** -privatekey="W:\Private.ppk" -passphrase=****".

When I run using script, is is failing to authenticate and expects the Hostkey.

May I know why it requires host key while we try to run the same using script?

Could you please give me the solution for this?