Results 1 to 8 of 8

Thread: [RESOLVED] waiting for .bat script execution to finish

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2006
    Posts
    19

    Resolved [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

  2. #2
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    Re: waiting for .bat script execution to finish

    This Link ?
    Please mark you thread resolved using the Thread Tools as shown

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Aug 2006
    Posts
    19

    Re: waiting for .bat script execution to finish

    perfect thank you very much

  4. #4
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    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

  5. #5
    New Member
    Join Date
    Mar 2009
    Posts
    3

    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

  6. #6
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    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.

  7. #7
    New Member
    Join Date
    Mar 2009
    Posts
    3

    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….

  8. #8
    New Member
    Join Date
    Mar 2009
    Posts
    3

    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
  •  



Click Here to Expand Forum to Full Width