Perfect - thank you!
Hilton
"AMercer" <(E-Mail Removed)> wrote in message
news:F36687FA-EF23-4314-99A7-(E-Mail Removed)...
> > How do I get it to run in the background without opening a window each
time
> > I call process.Start()?
>
> This vb fragment works for me and also reads back stdout of the launched
> process. I'm not sure how much of this is really necessary - I stopped
> experimenting when I got it to work.
>
> Dim s As String
> Dim p As New Process
> With p.StartInfo
> .FileName = "whatever.exe"
> .Arguments = "arg1 arg2"
> .UseShellExecute = False
> .RedirectStandardError = True
> .RedirectStandardInput = True
> .RedirectStandardOutput = True
> .WindowStyle = ProcessWindowStyle.Hidden
> .CreateNoWindow = True
> End With
> Try
> p.Start()
> s = p.StandardOutput.ReadToEnd()
> p.WaitForExit()
> Catch e As Exception
> s = e.tostring
> End Try
>
|