>I need to execute a DOS batch file within my program and I did it with
>RUN /N2 "File Name.BAT", and it works perfectly alright. My problem with this one is that since I use the /N2 flag the execution continues within my application eventhough the commands in batch file still pending. I need to overcome this problem and one option which I have in front of me is let the dos window run in foreground by removing the /N2 flag. I am searching for any other options which will help me in solving this problem.
Check Ed Rauh's API_APPRUN programming from the download section. It allows for the caller to wait for the batch file to complete. Another approach would be to use the Windows Script Host, translating the batch file (if necessary) to VBScript, and calling it with the WScript.Shell object's Run method, which has an optional parameter that will cause the caller to wait until completion.
George
Ubi caritas et amor, deus ibi est