Search code examples
c#communicationcross-process

How can I start/stop applications on a different computer?


Is it possible for one C# (desktop) application to start and stop applications on another machine?

I don't mean in a malicious sense, or even over the internet. I have two computers in a room and I need an app on one to start (and then stop) and app on the other.

One half-formed route in my mind was to use an auxiliary program on the target computer, so I suppose I ought to point out that I am completely able to make any necessary changes to either machine.


Solution

  • If you can do changes there are so many possibilities!

    • WMI : Never tried that out but given sufficient rights you should be able to start processes, or at least services on a remote machine
    • .NET remoting: Somewhat old, but easy to implement
    • WCF
    • HttpListener
    • Private Message Queues (that's what I did once)
    • ?

    Most of the alternatives involve writing a small service that listens on the communication technique of your choice and then starts a process or does something else.