I have a bat file a.bat
I want print throgh c# code..
How?
I used given code but not print
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.EnableRaisingEvents = false;
proc.StartInfo.FileName = "c:\\a.bat";
proc.StartInfo.Arguments = string.Format("C-Sharp Console application");
proc.StartInfo.CreateNoWindow = false;
proc.Start();
Bat file print
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Benjamin KemnerRank #7,492 · 240 reputationPosted Jul 19, 2011, 4:12 AM EDT
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.EnableRaisingEvents = false;
proc.StartInfo.FileName = "c:\\a.bat";
proc.StartInfo.Arguments = string.Format("C-Sharp Console application");
proc.StartInfo.CreateNoWindow = false;
proc.Start();
string out = proc.StandardOutput.ReadToEnd();
proc.WaitForExit();
Console.WriteLine ( out );