How to create a process with a different name?
-
I need to launch an executable multiple times passing in different argument list. Is there a way to use CreateProcess to launch the same executable but it shows in TaskManager as a different name? For e.g. ABC.exe gets launched as A1, A2 & A3. The reason for this is logging & configuration setup uses the process name & it would be easier to manage them with unique names instead of the executable name. Any pointers would be appreciated. TIA Chen Venkataraman
-
I need to launch an executable multiple times passing in different argument list. Is there a way to use CreateProcess to launch the same executable but it shows in TaskManager as a different name? For e.g. ABC.exe gets launched as A1, A2 & A3. The reason for this is logging & configuration setup uses the process name & it would be easier to manage them with unique names instead of the executable name. Any pointers would be appreciated. TIA Chen Venkataraman
Make copies of ABC.EXE, naming them ABC1.EXE, ABC2.EXE, and ABC3.EXE.
-
I need to launch an executable multiple times passing in different argument list. Is there a way to use CreateProcess to launch the same executable but it shows in TaskManager as a different name? For e.g. ABC.exe gets launched as A1, A2 & A3. The reason for this is logging & configuration setup uses the process name & it would be easier to manage them with unique names instead of the executable name. Any pointers would be appreciated. TIA Chen Venkataraman
You can pass a command-line parameter to the app via the CreateProcess call that it can use to set it's main window caption to. Task manager (and the launch bar) will use the main window caption for display.
-
You can pass a command-line parameter to the app via the CreateProcess call that it can use to set it's main window caption to. Task manager (and the launch bar) will use the main window caption for display.
Tried setting the title attribute of the
STARTUPINFO
structure but it didn't help. Task Manager still shows the executable as ABC.exe to continue with my example. But what i found is that if i specify both the lpApplicationName & lpCommandLine as follows, i can get a behavior close to what i want...lpApplicationName = ABC.exe
[need the .exe even though the doc says it is optional]lpCommandLine = myABC arg1 arg2...
etc Since argv[0] is interpreted as to mean the app name, by specifying a different name as the first token for the command line i could get the app to use this name instead of the executable name for picking up config & log stuff. I'm not sure if it is possible to get Task Manager to show a process with a different user-friendly name. Wondering how this is accomplished in the Unix world? [btw, this was an effort to simulate that behavior from the Unix side] Thanks for the response, anyway Chen Venkataraman -
Tried setting the title attribute of the
STARTUPINFO
structure but it didn't help. Task Manager still shows the executable as ABC.exe to continue with my example. But what i found is that if i specify both the lpApplicationName & lpCommandLine as follows, i can get a behavior close to what i want...lpApplicationName = ABC.exe
[need the .exe even though the doc says it is optional]lpCommandLine = myABC arg1 arg2...
etc Since argv[0] is interpreted as to mean the app name, by specifying a different name as the first token for the command line i could get the app to use this name instead of the executable name for picking up config & log stuff. I'm not sure if it is possible to get Task Manager to show a process with a different user-friendly name. Wondering how this is accomplished in the Unix world? [btw, this was an effort to simulate that behavior from the Unix side] Thanks for the response, anyway Chen VenkataramanIt's NOT possible to change the name in Task Manager. You must have some capability in the app that your launching to change the window title from a command line parameter in order to do what you want. RageInTheMachine9532