How I can execute a Batch Command in C# directly? How I can execute a Batch Command in C# directly? xml xml

How I can execute a Batch Command in C# directly?


Don't need to use "CMD.exe" for execute a commandline application or retreive the output, you can use "lmxendutil.exe" directly.

Try this:

processInfo = new ProcessStartInfo();processInfo.FileName  = "C:\\lmxendutil.exe";processInfo.Arguments = "-licstatxml -host serv005 -port 6200";//etc...

Do your modifications to use "command" there.

I hope this helps.


It doesn't look to me like your batch file will produce any output. If you run it in the command line, do you see an output? You have the redirection > operator in your bat file line, so it seems like you're sending output to the xml file.

If you have saved the output to an xml file, maybe you should just load that using C# once your process exits.