I have a C# (2010) application that I wish to run an EXE file and return the output text.
The partucular EXE is used to get version information which I would like to extract.
In a BAT file I have the following:
gsec.exe -user sysdba -password masterkey -z -quit
When i run this manually, I get the following output:
gsec version WI-V188.8.131.527
however, when run from the following code, I get nothing? I am missing something!!!
It does appear to be running as when I put 'pause' in the batch file, I get "Press any key" returned to the app!
Please help me,
Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = "C:\\Test.Bat";
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
string xResponse = p.StandardOutput.ReadToEnd();