Visual Basic Capture output of cmd

后端 未结 3 473
夕颜
夕颜 2020-12-04 02:28

I want Visual Basic to be able to run the \"make\" command on the directory \"C:\\projectTest\\\".

I tried to use this:

    Dim output As String = St         


        
3条回答
  •  [愿得一人]
    2020-12-04 02:59

    Errors are generally written to the StandardError stream and you are only reading the StandardOutput stream. Add an event handler for the ErrorDataReceived event and you should see the errors.

    AddHandler Process.ErrorDataReceived, _
           Sub(processSender As Object, lineOut As DataReceivedEventArgs)
               output += lineOut.Data + vbCrLf
           End Sub
    

提交回复
热议问题