|
-
Dec 14th, 2006, 09:23 AM
#1
Thread Starter
Junior Member
[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
-
Dec 14th, 2006, 09:28 AM
#2
Re: waiting for .bat script execution to finish
Please mark you thread resolved using the Thread Tools as shown
-
Dec 14th, 2006, 09:54 AM
#3
Thread Starter
Junior Member
Re: waiting for .bat script execution to finish
perfect thank you very much
-
Dec 14th, 2006, 09:55 AM
#4
Re: waiting for .bat script execution to finish
No Probs
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
Please mark you thread resolved using the Thread Tools as shown
-
Mar 11th, 2009, 01:34 AM
#5
New Member
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
-
Mar 11th, 2009, 11:26 AM
#6
Re: [RESOLVED] waiting for .bat script execution to finish
I think you are going to need to show us your .BAT file.
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
-
Mar 11th, 2009, 08:53 PM
#7
New Member
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….
-
Mar 11th, 2009, 08:59 PM
#8
New Member
Re: [RESOLVED] waiting for .bat script execution to finish
This is the actual code...
Application.zip
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|