M
mhmtzdmr
Hi,
I want to run an application and capture its output. But I receive the
error below in run-time.
"An unhandled exception of type 'System.ComponentModel.Win32Exception'
occurred in system.dll" Additional information: The system cannot find
the file specified
The sub is below.
RunApp("auunitref.exe", "-unit 95xx", "C:\Program Files\DA Manager
CLI")
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
p.StartInfo = psi
p.Start()
Label3.Text = p.StandardOutput.ReadToEnd()
p.WaitForExit()
End Sub
Thanks and regards.
I want to run an application and capture its output. But I receive the
error below in run-time.
"An unhandled exception of type 'System.ComponentModel.Win32Exception'
occurred in system.dll" Additional information: The system cannot find
the file specified
The sub is below.
RunApp("auunitref.exe", "-unit 95xx", "C:\Program Files\DA Manager
CLI")
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
p.StartInfo = psi
p.Start()
Label3.Text = p.StandardOutput.ReadToEnd()
p.WaitForExit()
End Sub
Thanks and regards.