[Pkg-mono-devel] Linux - Start Process / List Processes

Jo Shields directhex at apebox.org
Wed Aug 28 13:05:59 UTC 2013


On Tue, 2013-08-27 at 21:42 -0700, kamilon wrote:
> I'm starting a process like so:
> 
> ProcessStartInfo startInfo = new ProcessStartInfo("mono");
> startInfo.Arguments = "program.exe";
> Process.Start(startInfo);
> 
> The problem is when I try to find the processes that are running program.exe
> doesn't show up, only mono does.
> 
> How do I get a Process handle to program.exe again so I can kill it or do
> something else with it later?

You're sorta off topic for the list.

However, Process.Start(ProcessStartInfo) returns a Process, so 

int myPID = Process.Start(ProcessStartInfo).Id;

will start your process & shove its PID (for kill, etc) in an int. Or
keep the whole Process object around, if you prefer.




More information about the Pkg-mono-devel mailing list