I tried 3-4 versions and none worked for me.. I have a small exe for which i dont have the source anymore but it works good, but i still need the result string from it,
Process proc = new Process();
ProcessStartInfo StartInfo = new ProcessStartInfo();
StartInfo.RedirectStandardError = true;
StartInfo.RedirectStandardOutput = true;
StartInfo.FileName = path + "calculate.exe";
StartInfo.Arguments = input;
StartInfo.UseShellExecute = false;
StartInfo.CreateNoWindow = true;
proc.StartInfo = StartInfo;
proc.Start();
proc.WaitForExit();
string output = proc.StandardOutput.ReadToEnd();
MessageBox.Show(output);
i get an empty MessageBox, any ideas why? When i add a breakpoint at WaitForExit, StandardOutput says that it isn't redirected or the process didn't start yet.