Windows equivalent for Linux "screen" or another alternative?

Ubha picture Ubha · Feb 19, 2011 · Viewed 15.4k times · Source

I'm on the lookout for a method to control programs in a Windows environment.

I would prefer it to be a bit similar to the Linux software "screen".

The reason of my search is that I need to start a program (on Windows) with an identifier, so I later would be able to close that specific program, without closing anything else - even though the actual program (.exe file) is running multiple times. So is there anyway I can "name" it?

I'm using the following on Linux now:

$ screen <params> <id> ./softwareprogram

And then I know I can always find it with it's ID :)

It's an external program which is closing or starting a 3rd party program.

My program is written in C++, if that does any difference.

Edit: Can't I by any means not choose the ID myself? Like start the program with a specific name? Also how do I kill the process by providing a name?

Answer

Charles Grunwald picture Charles Grunwald · Jan 15, 2012

At the moment, I don't believe there's a native equivalent for screen. Cygwin contains an implementation of screen, but it comes with the overhead of cygwin. The problem is that Windows and Posix-based operating systems implement consoles in a very different way. Windows does not support many of the tty functionality that is part of the POSIX environment. That being said, it may be possible to write a minimal implementation of the functionality in the screen utility using the API calls: AttachConsole and FreeConsole. I'd have to do a bit more research on the subject, however.