After activating the window you can use SendKeys:

alias sendkeys { .comopen a WScript.Shell | .comclose a $com(a,SendKeys,3,*bstr,$$1-) }

//sendkeys $(%c,0)

Activating the window can also be done with com:

alias appactivate { .comopen a WScript.Shell | .comclose a $com(a,AppActivate,3,*bstr,$$1-) }

//appactivate TITLEOFTHEWINDOW

at which point you can use the sendkeys code above.

You can also refactor those two aliases to work as one, saving one (probably costly) /comopen and /comclose command

Note that you cannot use these methods to get any data out of your exe. If the EXE writes the result to stdout without a GUI you can use exec.dll to get the data in a much simpler fashion.