Hi guys, i have a code:
Dim ProcInfo As New ProcessStartInfo With {.FileName = AppName, .WorkingDirectory = Path.GetDirectoryName(AppName), .CreateNoWindow = False, .Arguments = Arguments, .RedirectStandardInput = False, .RedirectStandardOutput = True, .RedirectStandardError = True, .UseShellExecute = False}
Dim App As Process = Nothing
Dim Result As Integer = 0
If File.Exists(AppName) Then
Try
App = Process.Start(ProcInfo)
Console.WriteLine("App name: {0}" + Environment.NewLine, App.StartInfo.FileName)
Try
Do
' The StandardOutput don't read lineas when app is stop, when wait for something
Do Until App.StandardOutput.EndOfStream
Console.WriteLine(App.StandardOutput.ReadLine) ' "Press any key key to continue ..." not readed
Loop
App.Refresh()
App.WaitForExit(1000)
Loop While Not App.HasExited
Catch ex As Exception
Console.WriteLine("{0}", ex.Message)
End Try
Result = App.ExitCode
Catch
Console.WriteLine("Could not start process: {0}", App.StartInfo.FileName)
Return False
Finally
If Not App Is Nothing Then
App.Close()
End If
End Try
What i'm trying to do is write text from console windows, for example when i have in batch code "pause" (ex.
cmd.exe
/c echo ABDEDFG & echo 0123456789 & pause) VB doesn't see it, i'll see pause message after hit any key, i would like to get "please press any key" message in the same time when it is in console window. Could you help me with this
?