My problem is that I won't get the same result when running a command from command-line manually, or if I run it in C# I try to convert an .odt file to .rst (reStructuredText) and therefore I got the right tool, which works perfectly when I do it on my own: just send the command in cmd: "odt2rst.py input.odt output.rst" But when I try the same from code, it won't work. Sometimes it times out, sometimes it starts but does not finish. I mean I got half of the output.rst, simply cut in the middle or somewhere. I attach my C# code, if You could see something that I did wrong, please let me know; or as you got any kind if solutions.
System.Diagnostics.Process process = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
startInfo.FileName = "cmd.exe";
startInfo.WorkingDirectory = txt_output.Text;
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal;
startInfo.UseShellExecute = false;
startInfo.RedirectStandardOutput = true;
startInfo.RedirectStandardInput = true;
startInfo.RedirectStandardError = true;
process.StartInfo = startInfo;
process.Start();
process.StandardInput.WriteLine(@"odt2rst.py input.odt uncut.rst");
StreamReader k = new StreamReader(process.StandardOutput.BaseStream);
StreamReader l = new StreamReader(process.StandardError.BaseStream);
process.StandardInput.WriteLine(@"exit");
MessageBox.Show(k.ReadToEnd());
MessageBox.Show(l.ReadToEnd());
In the Messageboxes I see it starts working, but it just simply closes in the middle.
Thanks for your help!