I make a C# console program and I want to execute some batch treatments in an other cosole.
So, I have the main program which write in the console and at a certain moment I want to execute batch treatment in an other one.
I know how execute batch treatment in the main console but I want to do that in an other one, that is my question.
How can I make that ?
EDIT : I use a StreaWriter to write in the console like that :
Process process = new Process();
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = "cmd.exe";
startInfo.RedirectStandardInput = true;
startInfo.UseShellExecute = false;
process.StartInfo = startInfo;
process.Start();
using (StreamWriter writer = process.StandardInput)
{
if (writer.BaseStream.CanWrite)
{
// commands...
}
}