c# - Discrimanant taskkill.exe for excel.exe -


Let me run excel on a server and kill excel.exe process i am using taskkill.exe :

System.Diagnostics.Process.Start ("taskkill.exe", "-im excel.exe / f");

My only problem is that if anyone is using whatever the server is working on Excel (may be it) then their processes will also be killed. Anyway this is just around to kill excel files created by my code? Any help would be great. Thanks!

Keep track of the PID of the processes that you launch and with taskkill.exe / pid Kill NUMBER


Comments