ProcessStartInfo psi = new ProcessStartInfo(BatchFile)
Process p = Process.Start(psi)
Why p.ID is different than process id visible in WindowsTaskManager
(BatchFile is path to external program with appropriate parameters)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A process ID is only meaningful while the process is alive. The first thing to check is
.HasExited– if this is true, ignore the process ID; it no longer has any meaning.There are a number of ways you can start something and have no process left even though you can apparently see it still on screen: