Passing arguments to running programs

  • Thread starter Thread starter Dan Nilsson
  • Start date Start date
D

Dan Nilsson

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
tutorials on this matter..
 
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
 
Back
Top