I'm trying to execute a batch script which contains a pause statement at the end which I want to confirm:
var psi = new ProcessStartInfo(path, arguments);
psi.RedirectStandardInput = true;
psi.UseShellExecute = false;
psi.WorkingDirectory = workDir;
var p = Process.Start(psi);
p.StandardInput.WriteLine();
p.WaitForExit();
However, this code hangs forever in WaitForExit
although the process has already finished. I know that you have to read the buffer when redirecting standard output / error. Is there something special about redirecting standard input as well?