System.Diagnostics.ProcessStartInfo procStartInfo =
new System.Diagnostics.ProcessStartInfo("C://test.exe", "/c ");
procStartInfo.RedirectStandardOutput = true;
procStartInfo.UseShellExecute = false;
procStartInfo.CreateNoWindow =true; System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo = procStartInfo;
proc.Start();
foreach (Process p in Process.GetProcesses())
{
if (p.ProcessName == "test.exe")
{
p.Kill();
}
This code opens my exe and runs in background. But i didnt get the required output. And its not getting closed also. (functionally My exe should open and read two text files and generates some values on an output text file.)