简体   繁体   中英

What to pass command line argument in running exe. having multiple instance running with same exe name

I am making a window service which will trigger at specific time to start/run an .exe. There are many instance running depend on trigger event Example **

1. Trigger A fire at morning and start/run controller.EXE
2. Trigger B fire at Afternoon and start/run controller.EXE

** EDIT

I have used below

                Process A = new Process();
                A.StartInfo.FileName = @"Controller.exe"; 
                A.StartInfo.Arguments = strXML+" "+strEndDate;
                A.Start();

                Process B = new Process();
                B.StartInfo.FileName = @"Controller.exe"; 
                B.StartInfo.Arguments = strXML+" "+strEndDate;
                B.Start();

Now A and B both are running. I want to pass command line argument to process A while it is running

How can I achieve that. Is that possible with multiple exe having same name(controller.EXE)? 在此处输入图片说明

Answer to this question:

Is that possible with multiple exe having same name(controller.EXE)

Yes, sure. Look at Windows Task Manager in Process tab and you will see a lot of processes running with the same name. For instance, every tab in Chrome browser is running in its own process

在此处输入图片说明 .

About this

What to pass command line argument in running exe

You can pass any parameters you need or nothing. It depends on your application logic.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM