Link to home
Start Free TrialLog in
Avatar of newcomguy
newcomguy

asked on

Using System.Diagnostics.Process.Start

I have developed a console application that launches a variety of other applications using System.Diagnostics.Process.Start to initiate the process, such as:

Dim myProcess As Process = System.Diagnostics.Process.Start("e:\\app1\\setup.exe")
myProcess.WaitForExit()

For most of the applications it launches, this works fine. However, other applications do not run until immediately after I close the console window. (It will hang indefinitely if I leave it open.) This is not acceptable because, depending on the input given to the program, I may need to spawn other processes before terminating the console app. How can I fix the Process.Start call so these other pesky apps will launch without having to first close the console window?

Thanks in advance for your help.
Avatar of thenrich
thenrich

Why not use shell?
Shell("C:/Application.exe")
ASKER CERTIFIED SOLUTION
Avatar of thenrich
thenrich

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of newcomguy

ASKER

How would you recommend spawning a new thread for each process?
Just the way you are doing just get rid of the 'waitforexit' code.