I want to execute a batch command and save the output in a string, but I can only execute the file and am not able to save the content in a string.
Batch file:
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.