How to start a .exe program from a VB2008 program ?

  • Thread starter Gilbert Tordeur
  • Start date
G

Gilbert Tordeur

Hello,

I would like to know how I can start a .EXE program from a VB2008 program,
in the same thread (= like a subroutine). That means that my VB program
waits for the .exe program to finish. How can I look at its return code ?

Thank you in advance,
Gilbert
 
R

rowe_newsgroups

Hello,

I would like to know how I can start a .EXE program from a VB2008 program,
in the same thread (= like a subroutine). That means that my VB program
waits for the .exe program to finish. How can I look at its return code ?

Thank you in advance,
Gilbert

While I don't believe it can live as the same thread, you can easily
start an exe and wait for it to exit:

///////////////
Imports System.Diagnostics

Dim p As Process = Process.Start(...)
p.WaitForExit()
///////////////

Or something like that :)

Thanks,

Seth Rowe [MVP]
http://sethrowe.blogspot.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top