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\\se tup.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.
Dim myProcess As Process = System.Diagnostics.Process
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
Shell("C:/Application.exe"