I have to develop a small application that will connect to a Linux server (scp on port 22), upload a file, and then execute the file. The first thing that came to mind was to call WinSCP from my app, but the initial connection will always prompt to accept the hostkey. When calling WinSCP from the commandline you can press a key to copy the hostkey to the clipboard, and then you can use it with the -hostkey switch to connect. Any thoughts on how I might do this in VB? It would have to look like this:
- Attempt to connect via WinSCP
- Copy hostkey to clipboard when prompted
- Attempt to connect again using hostkey
I’m just not sure about #2. I would have to send a keystroke for the letter ‘C’ which causes the hostkey to be copied to the clipboard. Of course if there is a better way to do what I’m trying to do, please let me know.
Using Rebex, a 3rd party assembly that does everything I need.