I would like to know which process will be fired before a file is started with:
Process.Start("PathToFile");
Then I would like to have the path to the process.
Thank you.
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.
You can look at the
MainModuleproperty of the Process returned from Process.Start:However, you should remember that the return value from Proces.Start might be null – according to MSDN, the return value is:
Update
In order to know the executable prior to launching the process, you will have to look under HKEY_CLASSES_ROOT in the registry. This would be the code for going from a file name to the command the shell will execute when opening the file: