Hi,
My program uses the Process class to start a bat file that starts an
exe. When I run my program inside Visual Studio (debug) the bat and exe
run in the background (are not visible) and all their output is
redirected to my stream reader.
But when I try to run my program outside the IDE, the exe starts in
it's own window and my prgram is put on hold. When I exit the started
program the output of the bat is flushed to my stream.
Why does this work when I'm inside Visual Studio but not outside?!
Here is the simple code I use to start the bat...
prog= new Process();
prog.StartInfo.FileName = executable;
prog.StartInfo.UseShellExecute = false;
prog.StartInfo.RedirectStandardInput = true;
prog.StartInfo.RedirectStandardOutput = true;
prog.StartInfo.CreateNoWindow = true;
if(arguments != null)
{
prog.StartInfo.Arguments = arguments;
}
I hope somebody knows an answer, otherwise weeks of work will go down
the drain.
Br,
Tom