?
Solved

Using System.Diagnostics.Process.Start

Posted on 2004-10-06
5
Medium Priority
?
1,049 Views
Last Modified: 2012-05-05
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.
0
Comment
Question by:newcomguy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 5

Expert Comment

by:thenrich
ID: 12238498
Why not use shell?
Shell("C:/Application.exe")
0
 
LVL 5

Accepted Solution

by:
thenrich earned 420 total points
ID: 12238538
Why do you have:
myProcess.WaitForExit()

That maybe your problem
0
 
LVL 6

Assisted Solution

by:KGreg
KGreg earned 400 total points
ID: 12239447
you hve to get rid of waitforexit, or create a new thread for each process.  wait for exit locks the current thread until the process calling it is killed.

KGREG
0
 
LVL 1

Author Comment

by:newcomguy
ID: 12241748
How would you recommend spawning a new thread for each process?
0
 
LVL 5

Expert Comment

by:thenrich
ID: 12241767
Just the way you are doing just get rid of the 'waitforexit' code.
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses
Course of the Month10 days, 18 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question