// See https://aka.ms/new-console-template for more information using System.Diagnostics; string separator = "--------------------------------------"; Console.WriteLine(separator); Console.WriteLine("Console Test Application"); Console.WriteLine(separator); Console.WriteLine(); Console.WriteLine("calling ext app with args[]:"); string appPath = "./Utils/ExImp.exe"; string procArg = @"C:\Temp\test.log"; Console.WriteLine($"{appPath} {procArg}"); ProcessStartInfo psi = new ProcessStartInfo { FileName = appPath, Arguments = $"{procArg}", WindowStyle = ProcessWindowStyle.Minimized, //WindowStyle = ProcessWindowStyle.Hidden, UseShellExecute = false, //CreateNoWindow = true, RedirectStandardOutput = true, RedirectStandardInput = true, }; //childProc.StartInfo = psi; Process p = Process.Start(psi); string q = ""; while (!p.HasExited) { q += p.StandardOutput.ReadToEnd(); } Console.WriteLine("Ext prog ended"); Console.WriteLine("Data received:"); Console.WriteLine(); Console.WriteLine(q); Console.ReadLine();