473,406 Members | 2,549 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Starting an exe from a program

Hi everyone,

I have been having some problems with the following:

Using System.Diagnostics, I am starting several exe files from withing
Program.exe. Is there a way I can pause the execution of the rest of
Program.exe until the external processes finish. The only thing I can
think of is writing to a file
but I was hoping to find a more elegant solution. Currently I am using
threads and more specifically sleep() to "schedule" the execution of
code.

Any ideas will be highly appreciated?

Thanks,
Greg

Jun 12 '07 #1
4 1262
Try Process.WaitForExit Method () = Instructs the Process component
to wait indefinitely for the associated process to exit

Jun 12 '07 #2
Process.WaitForExit()?

"greg" <gr************@gmail.comha scritto nel messaggio
news:11*********************@z28g2000prd.googlegro ups.com...
Hi everyone,

I have been having some problems with the following:

Using System.Diagnostics, I am starting several exe files from withing
Program.exe. Is there a way I can pause the execution of the rest of
Program.exe until the external processes finish. The only thing I can
think of is writing to a file
but I was hoping to find a more elegant solution. Currently I am using
threads and more specifically sleep() to "schedule" the execution of
code.

Any ideas will be highly appreciated?

Thanks,
Greg
Jun 12 '07 #3
Call WaitForExit() on the Process instance(s).

Marc
Jun 12 '07 #4
It works! Thanks guys!

Jun 13 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Glenn | last post by:
I have used this code successfully in a form application. I tried to add the same code in a service and have not been able to get the application to start. I have the service starting with a local...
2
by: banduraj | last post by:
I am working on starting and managing TCP connections manually. I build the IP headers and TCP packets manually and send them on my own. The problems I run into seems to be related to the Sockets....
6
by: Arnie | last post by:
We're using the ServiceController class provided by the .NET Framework, programming in C#. We are using the Start() method to start a service from another service. This works fine most of the...
16
by: Jim Langston | last post by:
I know that functions starting with an underscore, or two underscores, are reserved by the compiler/c++ and should not be used by the user and may cause undefined behavior. My question is, how...
0
by: C. Hughes | last post by:
Hi, I have used the standard tools in VS 2005 to compile my VB application into a setup file. After executing the setup file and installing the program, starting the program often presents an...
4
by: vikerneso | last post by:
I'm trying to write a program that would take a text file and searched for every word starting with a user specified letter. i.e. user inputs 'a' the program searches through the text file and...
3
by: Patrick Dugan | last post by:
I am using VS2005 (vb) and I have a program that starts when Windows boots up. Occasionally the icon that should appear in the system tray does not show up. The program is still running in memory...
34
by: Umesh | last post by:
I want to extract a string abc*xyz from a text file. * indicates arbitrary no. of characters. I'm only able to do it when the string has definite no. of characters or the string length is...
5
by: Bjarne Nielsen | last post by:
Hi all I have developed a program, that runs under .NET framework 2.0. On my own computer and all the other computers in my company, things run smoothly. My problem is, that I have installed...
1
by: CL4life | last post by:
I have the following problem: a program, located on drive a known drive (for example lets say drive C:) needs to execute a program on an unknown different drive (a USB device which doesn't have the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.