How to automatically respond or ignore questions and warnings in Winscp when using the command line?

Advertisement

Marco Avellar
Joined:
Posts:
1
Location:
Brasil

How to automatically respond or ignore questions and warnings in Winscp when using the command line?

Hello !
Sometimes when you run some scripts or command lines, Winscp returns questions such as:
"Remote file 'xxxxxxx' already exists. Overwrite?"
or
"The server's rsa2 key fingerprint is: ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:x:xx:xx:xx:xx. 2018-08-03 10:18:20.487
If you trust this host, press Yes. To connect without adding host key to the cache, press No. To abandon the connection press Cancel
."

What can I do in Script or the command line, to respond or ignore them automatically?"

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
29,561
Location:
Prague, Czechia

Re: How to automatically respond or ignore questions and warnings in Winscp when using the command line?

I assume you are using some old version of WinSCP. Recent versions do not prompt for overwrites, when executing scripts.

Though that does not apply for host key confirmation. You should never try to automate that!
See https://winscp.net/eng/docs/scripting#hostkey

Reply with quote

Advertisement

You can post new topics in this forum