unable to get the -hostkey=* option to work
I am running WinSCP version 5.1.8 and am trying to use the following command in a batch file
winscp.exe /console /command "option batch on" "option confirm off" "open sftp://root:MyPasswordHere@ServerNameHere/tmp -hostkey=*" "put D:\Some\File\OnThe\Server.txt" "exit"
I have also tried a variety of quote marks, like this
winscp.exe /console /command "option batch on" "option confirm off" "open sftp://root:MyPasswordHere@ServerNameHere/tmp -hostkey="*"" "put D:\Some\File\OnThe\Server.txt" "exit"
And this, which I found in a post on this forum
winscp.exe /console /command "option batch on" "option confirm off" "open sftp://root:MyPasswordHere@ServerNameHere/tmp -hostkey=""*"" "put D:\Some\File\OnThe\Server.txt" "exit"
None of these work, the script still stops and prompts to accept the new host key. If I manually accept the host's key and save it in the cache, then run the script again it works fine.
winscp.exe /console /command "option batch on" "option confirm off" "open sftp://root:MyPasswordHere@ServerNameHere/tmp -hostkey=*" "put D:\Some\File\OnThe\Server.txt" "exit"
I have also tried a variety of quote marks, like this
winscp.exe /console /command "option batch on" "option confirm off" "open sftp://root:MyPasswordHere@ServerNameHere/tmp -hostkey="*"" "put D:\Some\File\OnThe\Server.txt" "exit"
And this, which I found in a post on this forum
winscp.exe /console /command "option batch on" "option confirm off" "open sftp://root:MyPasswordHere@ServerNameHere/tmp -hostkey=""*"" "put D:\Some\File\OnThe\Server.txt" "exit"
None of these work, the script still stops and prompts to accept the new host key. If I manually accept the host's key and save it in the cache, then run the script again it works fine.