On 1 Feb, 09:48, ludwig_stu...@hotmail.com wrote:
Hi,
does someone has some links to information about how I would approach
and implement batch processing in C#?
Thanks!
Kind regards,
Ludwig
you mean how to run a batch file?this code below will run a system
command:
{
ProcessStartInfo psiOpt = new ProcessStartInfo(@"cmd.exe", @"/c dir");
psiOpt.WindowStyle = ProcessWindowStyle.Normal;
psiOpt.RedirectStandardOutput = true;
psiOpt.UseShellExecute = false;
psiOpt.CreateNoWindow = true;
// Create the actual process object
Process procCommand = Process.Start(psiOpt);
// Receives the output of the Command Prompt
StreamReader srIncoming = procCommand.StandardOutput;
// Show the result
MessageBox.Show(srIncoming.ReadToEnd());
// Close the process
procCommand.WaitForExit();
}