Process.Start WaitForExit
*
Dim p As New Process
Dim info As New ProcessStartInfo
info.UseShellExecute = False
info.CreateNoWindow = True
info.FileName = "cmd.exe"
info.Arguments = "/c dir *.*"
info.RedirectStandardOutput = True
p.StartInfo = info
p.Start()
p.WaitForExit()
MsgBox (p.StandardOutput.ReadToEnd())
Public Class Form1

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        Dim p As New Process
        Dim info As New ProcessStartInfo
        info.UseShellExecute = False
        info.CreateNoWindow = True
        info.FileName = "cmd.exe"
        info.Arguments = "/c pause"
        info.RedirectStandardOutput = True
        p.StartInfo = info
        p.Start()
        p.WaitForExit()
        REM MsgBox(p.StandardOutput.ReadToEnd())
        MsgBox("end")
    End Sub
End Class

이 게시물을

공유하기

SEARCH

MENU NAVIGATION