test

  • Register
Welcome to Khemlall Q&A, where you can ask questions and receive answers from other members of the community.

How to execute command line in c#

0 votes
How to execute command line in c#

/ Start the child process. Process p = new Process(); // Redirect the output stream of the child process. p.StartInfo.UseShellExecute = false; p.StartInfo.RedirectStandardOutput = true; p.StartInfo.FileName = "YOURBATCHFILE.bat"; p.Start(); // Do not wait for the child process to exit before // reading to the end of its redirected stream. // p.WaitForExit(); // Read the output stream first and then wait. string output = p.StandardOutput.ReadToEnd(); p.WaitForExit();
asked 1 year ago in C# Code by anonymous

1 Answer

Related questions

0 votes
1 answer
asked 10 months ago in C# Code by anonymous
0 votes
1 answer
asked 1 year ago in C# Code by anonymous
0 votes
0 answers
asked 2 years ago in C# Code by anonymous
0 votes
1 answer
0 votes
0 answers
asked 2 years ago in C# Code by anonymous