473,320 Members | 1,799 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,320 software developers and data experts.

WaitForExit( 1 ) never returns

Hi All

I am writing a C# program that starts another program. Since this is
destined to run on an un-attended PC, I want to be certain that my program
can regain control. To this end, I use the WaitForExit methos with a
timeout.

So in order to test this, I added an endless loop to the other program such
that it never returns. My problem is that neither does WaitForExit. Even
WaitForExit( 1 ) never returns when the other program hangs.

Why? And what should I do to make it work?

Ebbe
Oct 2 '06 #1
1 3073
Ebbe Kristensen wrote:
Why? And what should I do to make it work?
Never mind - it turned out that using MyProccess.StandardError.ReadToEnd()
was the culprit. Changing that to asynchroneous collection solved the
problem.

Ebbe
Oct 2 '06 #2

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

Similar topics

1
by: Art Vandelay | last post by:
Hello, I am trying to execute a VBScript, that exists inside of my project (via Add New Item>VBScript), through a button1_click event. I have not been able to find any code samples to...
0
by: Ram | last post by:
Hey, I'm trying to the "gacutil" exec to register an assembly form an aspx file using the Process Object. Here's the code: Process objProc; objProc = new Process(); ...
1
by: UJ | last post by:
I know I know - I've already posted this in the DOTNET.general area but my problem seems to be specific to asp.net so I'll recap here...... I (after much work) got to the point where I have a...
4
by: Terry Brown | last post by:
I am trying to use WaitForExit to determine when an external application I have launched has exited (duh!). I found examples everywhere and it seemed simple and this works perfectly: Dim...
6
by: henk | last post by:
Hi, I want to show a message in my vb.net program when another windows program (eg calc.exe) is stopped by a user. with pList = myProcess.GetProcesses For Each myProcess In pList I can check...
4
by: eva.monsen | last post by:
I'm trying to run a .BAT file using System.Diagnostics.Process. I'm having trouble getting Process.ExitCode to match up with what the .BAT file returns. Here are the contents of...
4
by: Zorpiedoman | last post by:
dim FileName as string = "Test.doc" dim P as Process = Process.Start(FileName) '--P is NOTHING even though document opens!!! dim Q as new process Q.StartInfo.FileName = FileName P = Q.start...
5
by: andrew | last post by:
Hi, I have the following issue with the Thread.Abort(): The main thread creates a worker thread which waits on a process termination. void ThreadProc() { Process proc =...
2
by: test3 | last post by:
Hello folks, I'm using System.Diagnostics.Process to start a thirdparty program (that works perfectly when started via command line). I'm using Process.StandardOutput to get the output of the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.