How to start a Windows GUI app from telnet

Solution 1:

See http://msdn.microsoft.com/en-us/library/ms687096(VS.85).aspx for a long and detailed though ultimately unhelpful description of what is happening when you launch apps from a telnet session. Many years ago I wrote a telnet server for Windows NT3.50 and I learned all this stuff the hard way :-)

I think you need to look again at what you're trying to do. From your description I'd guess that you have some GUI app being run by a logged in user and you want to kill it so you can do some maintenance then restart it. Killing it is easy as you can just kill the process. Restarting it in any useful way is harder. Could you set the PC to autologin and run the app from the Start Menu? Then you could just restart the PC when you've grabbed your files. I'm somewhat ashamed to admit this is what I did under similar circumstances.

JR

Solution 2:

It looks like this is not possible with the Windows telnet service. I even tested running the service under the local system account with "interact with desktop" enabled, but that did not work (which is fine as it would have serious security implications).

As an alternative to using telnet, I would recommend PsExec. PsExec is part of the SysInternal tools now managed by Microsoft. Use the -i option to enable desktop interaction.

psexec \\machine -u user -p password -i -w "C:\application" myapp.exe

You can download PsExec here.

Solution 3:

This shouldn't be possible to interact with any GUI apps because the telnet server doesn't provide you with access to a window station in which the GUI app run. In order to run a remote Windows GUI app, you need to start it within a terminal services session (or similar).

Solution 4:

Do you have to use Telnet? Remote Desktop would allow you to stop and start the program interactively, and you could still use FTP to move the files. The downside: the remote computer will be locked once you disconnect, and if you log off, the program will stop running.