Este es el código para obtener la salida de un comando shell en vb.net. ApplicationName.exe es el proceso a ejecutar y sOutput es la salida capturada generada por el proceso.
Dim oProcess As New Process() Dim oStartInfo As New ProcessStartInfo("ApplicationName.exe", "arguments") oStartInfo.UseShellExecute = False oStartInfo.RedirectStandardOutput = True oProcess.StartInfo = oStartInfo oProcess.Start() Dim sOutput As String Using oStreamReader As System.IO.StreamReader = oProcess.StandardOutput sOutput = oStreamReader.ReadToEnd() End Using Console.WriteLine(sOutput)
Deja un comentario