I write a planner or sort. This is basically a table with a list of exes (for example, "C: \ a.exe") and a console application that scans records in the table every minute and runs tasks that have not yet been completed.
I run the following tasks:
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.FileName = someExe;
p.Start();
How can I find out if a specific task failed? For example, what if a.exe throws an unhandled exception? I would like the code above to know when this will happen, and update the task table with something like “a specific task failed”, etc.
How can i do this?
I do not use Sql Agent or Windows Scheduler because someone did not tell me. He has more “experience”, so I basically follow orders. Feel free to suggest alternatives.
source
share