Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Waiting for a batch process to finish 1

Status
Not open for further replies.

jbrowne

Programmer
Feb 1, 2000
182
IE
Hi,

I am running a batch file from VB which in turns runs a java compiler on a java file from a VB application. I am passing parameters to the compiler from VB through batch file. I am using the Shell command to run the batch file. It all works perfectly fine until I try to loop the shell command into calling the java compiler several times in quick succession. I cannot figure out how to wait for the previous process to finish before starting the next one.

There is a createprocess API available and also a WaitforSingleObject API which I have been trying to use but without any success. I can't seem to pass in my parameters successfully using this. Am I doing something wrong or is there an easier solution to this problem.

Thanks
John B
 
if you use the windows scripting host shell object (should be available as a project reference) it has the functionality to break until the process has ended.
 
I used the shell command originally because you could hide the black dos screen that the java compiler puts up when running with a vbhide parameter - can you do this using the windows scripting host sheel object?
 
I can't honestly remember off of the top of my head, it is fairly functional though so I would imagine you would be able to.
 
I have used this code many times and it has not failed me yet.

faq222-428

Swi
 
Brilliant - thanks Swi that code worked a treat !!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top