Herfried,
Thanks for your sample. Here are some other questions...
1. If I have 3 string arguments that I want to pass to the executable, with
the .Arguments, is the syntax like :
..Arguments = "one two three" ?
I will have these 3 arguments in string variables already within my coded.
2. Will the ExitCode be a numeric value that I can set within my executable
to return in case there is a failure or is it some generic error number?
Thanks again.
STom
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:e5**************@TK2MSFTNGP09.phx.gbl...
"STom" <st***********@hotmail.com> schrieb:I am trying to find a way to run a .Net executable from within my vb.net
code. I need to pass parameters into the executable and wait for a return
and check the return value for an error before continuing.
\\\
Imports System.Diagnostics
.
.
.
Dim psi As New ProcessStartInfo()
With psi
.FileName = "foo.exe"
.Arguments = ...
End With
Dim p As Process = Process.Start(psi)
p.WaitForExit()
MsgBox(CStr(p.ExitCode))
///
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>