In my Winform application, I need to call a DOS or Console application and I do that with the following code:
Process proc = new Process();
proc.StartInfo.FileName = lLocation.Text+"\\pywin32.exe";
proc.StartInfo.Arguments = lLocation.Text+"\\data.pos";
proc.Start();
Problem is that after the application outputs the result on the screen, the Command Prompt closes immediately, so I can not read the result of that application.
One solution would probably be to create .bat file with “pause” command in the end and use that in the Process class, but I am wondering, if there is another way?
You could just read the output of the process:
Then do whatever you wish with the output.