Kitty does not know how to open external applications when the connection, it can not confirm the existence of the tunnel, filing out some kind of signal.
I would have made the script using plink. Will run quietly work in the background.
If it returns 0, then start the RDP connection.
Really need to figure out how to beat plink.exe process. Maybe it would be better to always leave it in the background.
According to this principle a few well-known programs for Windows (e.g. HeidiSQL).
Be careful: when you first connect, plink asks for interactive confirmation key fingerprint (y/n). It is theoretically possible to hide via -batch.
Rusty.Ebe answered on July 8th 19 at 16:05
if the test port for openness = ok goto rdp
else goto test
then launch rdp