I am executing one .net console from another console App. Eg MyTool.exe < input.txt
Where Input.txt will have all the input required by tool.
The input in the input file should be dyanmic, so to achive this.
I created another wrapper console App MyWrapper.exe. This is first crating the input.txt file and then calling the MyTool.exe using .Net Process().
Content of batch file
MyTool.exe < input.txt
var proc = new Process();
proc.StartInfo.FileName = "MyBatchFIle.bat";
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.RedirectStandardOutput = true;
proc.Start();
Now here is the question. Say in case of error or incorrect input, there is possibility that MyTool.exe can go to infinite loop.
So I want to detect this kind of error and stop the execution.
My plan is to execute the MyWrapper.exe from Windows scheduler.
Thanks, Siraj