M
mhmtzdmr
Hi,
I want to run an application and capture its standard output. But the
following code does not generate any output. Can anyone see something
wrong?
Public Sub RunApp(ByVal myprocess As String, ByVal param As String,
ByVal workingDir As String)
Dim p As Process = New Process()
Dim psi As New ProcessStartInfo()
psi.FileName = myprocess
psi.WorkingDirectory = workingDir
psi.Arguments = param
psi.UseShellExecute = False
psi.CreateNoWindow = True
psi.RedirectStandardOutput = True
psi.RedirectStandardInput = True
psi.RedirectStandardError = True
p.StartInfo = psi
p.Start()
AppendLine(p.StandardOutput.ReadToEnd)
p.WaitForExit()
End Sub
-----------
Then I call the sub like below.
RunApp("c:\auunitdel.exe", "-d", "")
Thanks...
I want to run an application and capture its standard output. But the
following code does not generate any output. Can anyone see something
wrong?
Public Sub RunApp(ByVal myprocess As String, ByVal param As String,
ByVal workingDir As String)
Dim p As Process = New Process()
Dim psi As New ProcessStartInfo()
psi.FileName = myprocess
psi.WorkingDirectory = workingDir
psi.Arguments = param
psi.UseShellExecute = False
psi.CreateNoWindow = True
psi.RedirectStandardOutput = True
psi.RedirectStandardInput = True
psi.RedirectStandardError = True
p.StartInfo = psi
p.Start()
AppendLine(p.StandardOutput.ReadToEnd)
p.WaitForExit()
End Sub
-----------
Then I call the sub like below.
RunApp("c:\auunitdel.exe", "-d", "")
Thanks...