Hi,
I want to open one new CMD from console application, write text into the new CMD and then coming back to the control on the old cmd. (like interactively working on the both)
please look into the below code
it is giving the exception "StandardIn has not been redirected"
Please help me on this issue
I want to open one new CMD from console application, write text into the new CMD and then coming back to the control on the old cmd. (like interactively working on the both)
please look into the below code
Code:
Process P1 = Process.Start(@"C:\WINDOWS\system32\cmd.exe"); P1.StartInfo.RedirectStandardInput = true; P1.StartInfo.RedirectStandardOutput = true; P1.StartInfo.UseShellExecute = false; StreamWriter wr = P1.StandardInput; wr.WriteLine("First line in New Cmd"); Console.WriteLine("First line in Old Cmd"); wr.WriteLine("Second line in New Cmd"); Console.WriteLine("Second line in Old Cmd");
Please help me on this issue
Comment