The code is as follows:
ProcessStartInfo startInfo = new ProcessStartInfo("cmd", "/c" + command);
startInfo.CreateNoWindow = true;
startInfo.UseShellExecute = false;
startInfo.WindowStyle = ProcessWindowStyle.Normal;
startInfo.Arguments = arguments;
startInfo.RedirectStandardError = true;
startInfo.RedirectStandardOutput = true;
Process process = Process.start(startInfo);
StreamReader srOutput = process.StandardOutput;
string output = srOutput.ReadToEnd();
Team rmdir /s /q 123
I expect to get "The system cannot find the specified file" inside the variable outputcos "123" - this is the path to the file that does not exist. But output- an empty line. Why and how am I going to get a conclusion?
source
share