I am coding a GUI Interface to execute an executable that executes via a command line.
I want to retrieve any errors that when running the executable with arguments that it may generate.
the code below seem to work to display the last message if it runs successfully when you exit the program, but any errors it does not show.
What can I change in order to allow it to retrieve the errors. when it gets an error I just get blank value.
I want to retrieve any errors that when running the executable with arguments that it may generate.
the code below seem to work to display the last message if it runs successfully when you exit the program, but any errors it does not show.
Code:
Dim myProcess As New Process()
Dim myProcessStartInfo As New ProcessStartInfo("c:\mame0166b\mame64")
myProcessStartInfo.WorkingDirectory = "c:\mame0166b"
myProcessStartInfo.Arguments = "ti99_4a single"
myProcessStartInfo.UseShellExecute = False
myProcessStartInfo.RedirectStandardOutput = True
myProcess.StartInfo = myProcessStartInfo
myProcess.Start()
Dim myStreamReader As StreamReader = myProcess.StandardOutput
' Read the standard output of the spawned process.
Dim myString As String = myStreamReader.ReadToEnd()
myProcess.Close()
'Show Mystring
MsgBox(myString)
What can I change in order to allow it to retrieve the errors. when it gets an error I just get blank value.