I'm trying to set up a Windows machine as an SSH server so that I can SSH to it from another Windows machine.
I installed OpenSSH on the server and can successfully connect to it from another Windows client using Putty. I'm trying to write a script that will open a specific application and then run an Autohotkey script to perform some action within that application. I have a batch file on the SSH server. If I run that batch file locally it does exactly what I want it to do: it opens the application, runs the Autohotkey script, and exits gracefully. However, if I open that same batch file through an SSH session, the application process starts (I see the process in Task Manager), but the GUI doesn't actually open. From what I've been able to find, it's likely due to the fact that SSH is running as a service and will not open the application as the currently logged in user. To try to circumvent this, I attempted the "runas" command. Again, I have the same outcome (the .exe shows up in Task Manager, but the GUI doesn't open). Additionally, both of these methods open the AHK script but the script doesn't perform any actions.
I've also tried another SSH server, freeSSHd, that does NOT run as a service. Using this, I can get the script to do exactly what I want via SSH. However, this solution doesn't work for me because ideally there won't be any peripherals connected to the SSH server. It will just be connected to the network via Ethernet. If it's not running as a service, that means I'll need to manually open the application and click on the "Start SSH server" button each time it restarts.
How can I open a GUI application over SSH?