all groups > c# > august 2004 >
You're in the

c#

group:

Passing arguments to running programs


Passing arguments to running programs dan.nilsson NO[at]SPAM oktv.se
8/21/2004 11:48:51 PM
c#:
I am developing a command line program which needs to get information
from command line switches every now and then. So instead of starting
a new instance when the program is executed, it will pass an event or
message to the already running program telling it what it would do.

For example:

First program.exe is executed and the program is started. Then we run
program.exe /cleardatabase and the running process receives this
request and acts accordingly.

I know this is probably basic stuff but I have been unable to find any
Re: Passing arguments to running programs Bob Grommes
8/22/2004 7:08:51 AM
Dan,

Hm. I'd probably use a named Mutex to determine whether I'm the first
instance running or not. If I'm the first instance, I become a remoting
server. Subsequent instances will become clients of that server. You could
then expose server methods that can be called to pass in requests.

The devil would be in the details, but it should be doable.

--Bob

[quoted text, click to view]

AddThis Social Bookmark Button