Hello Friends!
Can you help me for calling a exe or bat file by the code of vb6.0?
Thanks.
Can you help me for calling a exe or bat file by the code of vb6.0?
Thanks.
Private Sub Button2_Click(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles Button2.Click
Dim psi As New _
System.Diagnostics.ProcessStartInfo("C:\listfiles.bat")
psi.RedirectStandardOutput = True
psi.WindowStyle = ProcessWindowStyle.Hidden
psi.UseShellExecute = False
Dim listFiles As System.Diagnostics.Process
listFiles = System.Diagnostics.Process.Start(psi)
Dim myOutput As System.IO.StreamReader _
= listFiles.StandardOutput
listFiles.WaitForExit(2000)
If listFiles.HasExited Then
Dim output As String = myOutput.ReadToEnd
Debug.WriteLine(output)
End If
End Sub
Comment