[RESOLVED] waiting for .bat script execution to finish
Hi all
I have some Vb code which runs a .bat file part way through the code, then runs some more commands, but I want the .bat file execution to finish before it continues -
Code:
Sub Main ()
Shell ("C:\run.bat")
'Now run some more code, but only once the .bat file has terminated
end sub
So as above, the .bat file is invoked but only once it has completed do I want the commands which fiollow to start executing. Does anyone know how I can do this?
Thanks
Re: waiting for .bat script execution to finish
Re: waiting for .bat script execution to finish
perfect thank you very much
Re: waiting for .bat script execution to finish
No Probs :wave:
If u have your answer please go to the thread tools and click "Mark Thread Resolved" :)
Re: [RESOLVED] waiting for .bat script execution to finish
A little OT sir danasegarane...
I tried to use your code for my project but the problem is the .bat file that im trying to execute is not executing by the code you gave... Im not sure actually whats the problem... can you help me with this...
sorry for my english
Re: [RESOLVED] waiting for .bat script execution to finish
I think you are going to need to show us your .BAT file.
Re: [RESOLVED] waiting for .bat script execution to finish
Sir thanks for the reply and concern... Well I already solve the problem and found out that the problem is cause of by one just one line of code...
Program Flow:
1. cmdbutton click
2. program produce .bat file from the result of some source
3. program execute .bat file
4. program wait for the .bat file to finish
5. program open .csv file that produce by the .bat
6. program make .xls files by combining 2 .csv files
7. etc....
Problem:
1. .bat file is produced and the content is ok but cant open by the program properly.
Reason:
1. Forgot to close the .bat file that the program created before it is used.
.... Well the task that I want for my program to do can already be done by my program but some of the people who see the program work still think that it is slow and consume a lot of memory any suggestion you guys can recommend for improvement?
I will try to post the actual codeā¦.
1 Attachment(s)
Re: [RESOLVED] waiting for .bat script execution to finish
This is the actual code...
Attachment 69631