Can i programatically compile a batch file form c#. Meaning that I give the location of the file and some C# Library compiles the file and gives the output
开发者_运维百科Can anyone tell me the library for C# that can help me write a small intepreter for C#
Batch files in windows do not get compiled. They get executed by a command processor.
You can use Process.Start
to execute a batch file from within a C# program.
If I assume this is just a regular windows batch file, you could run it like this:
System.Diagnostics.Process.Start('myfile.bat');
That will return a Process
object. From there you can get the output stream from the process and read whatever text the batch file writes to the console.
精彩评论