Process firing event too quickly
-
Hi people, I am running a DOS batch file (.bat) from inside a C# code. I am using the Process class to do that. The problem I have is weird, it seems that on the dev machine, the process is firing the event too quickly (i.e. it is not even executing) and since the call is supposed to create a file on disk, the file of course is not found. On the other hand, on a normal (client) machine, it seems to work, but i'm not sure that it works all the time. Could anyone give me some solution to this weird problem? Thanks, Talal
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." --Rich Cook
-
Hi people, I am running a DOS batch file (.bat) from inside a C# code. I am using the Process class to do that. The problem I have is weird, it seems that on the dev machine, the process is firing the event too quickly (i.e. it is not even executing) and since the call is supposed to create a file on disk, the file of course is not found. On the other hand, on a normal (client) machine, it seems to work, but i'm not sure that it works all the time. Could anyone give me some solution to this weird problem? Thanks, Talal
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." --Rich Cook
-
Are you calling the process synchronously or asynchronously? An asynchronous call returns immediately without waiting for the process to finish executing.
--- Year happy = new Year(2007);
hi, thanks for the quick reply. well as a matter of fact, I'm calling it asynchronously, I am using the event p.Exited += new EventHandler(Ended) to perform some processing once the command line process has terminated. Thanks, Talal
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." --Rich Cook