'Imports System.Diagnostics

        Dim p As New Process

        p.StartInfo.FileName = "cmd.exe"

        p.StartInfo.UseShellExecute = False

        p.StartInfo.RedirectStandardInput = True

        p.StartInfo.RedirectStandardOutput = True

        p.StartInfo.RedirectStandardError = True

        p.StartInfo.CreateNoWindow = True '不想看见那个黑黑的dos窗口

        p.Start()

        p.StandardInput.WriteLine("pint -n 1 192.168.10.100") '不小心把ping写成pint了

        p.StandardInput.WriteLine("ping -n 1 192.168.10.100")

        p.StandardInput.WriteLine("exit")

        Dim strRet As String

        strRet = p.StandardOutput.ReadToEnd()

        MsgBox(strRet)

        strRet = p.StandardError.ReadToEnd()

        MsgBox(strRet)

相关文章:

  • 2021-06-13
  • 2022-12-23
  • 2021-12-30
  • 2021-06-09
  • 2022-01-25
  • 2022-01-08
  • 2021-05-29
  • 2021-10-30
猜你喜欢
  • 2021-06-07
  • 2021-06-16
  • 2021-05-22
  • 2021-09-10
  • 2022-12-23
  • 2022-03-05
  • 2021-12-28
相关资源
相似解决方案