I am starting an executable using this code:
Process proc = new Process(); proc.StartInfo.FileName = executablePath; proc.Start(); proc.WaitForInputIdle(); <
Below also returns the PID of a process
Process[] p = Process.GetProcessesByName("YourProcessName");
Now you can get process Id by using p[i].Id;
p[i].Id;