How do I start a process and wait for it?

G

Guest

windows C#

I want to run an application from another application and wait til it is
exited. At the moment I have something like this:

System.Diagnostics.Process myApp = new Systems.Diagnostics.Process();

myApp.StartInfo.FileName = @"C:\myapp.exe";
myApp.Start()

The problem is this fires off myapp.exe and then is itself left floating
around after myapp.exe has been closed down. How can I run myapp.exe, then
either close down the calling app, or return to it?

Thanks

Steve
 

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