My goal is to launch a simple AutoHotKey script in Windows 10 machine from Ubuntu host within the same private network. After googling, I found winexe, which sounded like it could do what I want, but after many trials, I failed to connect it to Windows 10 ("Failed to open connection - NT_STATUS_CONNECTION_RESET", further googling didn't help). As a second solution, I've installed SSH server on Windows machine (Bitvise SSH Server). Now I can login from Ubuntu via ssh to Windows or just run commands on Windows machine:
$ ssh user@windowsmachine command
This works for regular commands like DIR, MKDIR, ... but it does not work for AutoHotKey scripts. E.g., with
$ ssh user@windowsmachine 'C:\path\to\script.ahk'
nothing happens on Windows machine (launched locally, this test script just shows a greeting message box). The following attempts also do not work:
$ ssh user@windowsmachine '"C:\Program Files\AutoHotkey\AutoHotkey.exe" C:\path\to\script.ahk' $ ssh user@windowsmachine 'cmd.exe /c C:\path\to\script.ahk'
UPDATE: The trick almost works. E.g., it does launch calc.exe:
$ ssh user@windowsmachine calc.exe
But if I launch notepad.exe or any other application, I see them in the taskmanager running as background processes, without GUI. (I don't know wjat so specual about calc. exe that it runs normally). I also managed to fix the problem with winexe, but the situation is absolutely the same as with ssh - except calc.exe, all GUI apps are launched as background processes. THis problem is discussed here. So the bottom-line is that it takes enormous effort to run GUI apps in Windows 10 from Linux host. So I just have written my own little client-server app in Qt 5, which listens to a certain port, and runs corresponding apps/scripts when a user-defined command is received from another host.