944,110 Members | Top Members by Rank

Ad:
May 4th, 2005
0

Wait/Pause Application before next process.

Expand Post »
The application I am writing involves creating a dos batch file and executing it using the 'Shell' command.

The batch file is used to zip up multiple files.

The zip file that is created is them emailed.

My problem is - creating a pause within the application so the zip file can be created. I have tried a simple pause (for t=1 to 100000: next t). I know this isnt the best way to do it.

:!: The zip file could take between 0.5 to 30 seconds to create.

Any help would be great.
Cheers
PG
Similar Threads
Reputation Points: 24
Solved Threads: 6
Junior Poster in Training
purplegerbil is offline Offline
78 posts
since Apr 2005
May 4th, 2005
0

Re: Wait/Pause Application before next process.

Are You trying to make the batch file pause, or the VB Program wait until the batch file is done? If you are trying to wait until the batch file is done, don't use shell. (you can use shell, but it's a lot more code than this here). Use WSH within VB, as such:

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. dim wsh
  2. set wsh = createobject("WScript.Shell")
  3. wsh.Run "c:\somebatchfile.bat", 0, 1
Team Colleague
Reputation Points: 361
Solved Threads: 214
Taboo Programmer
Comatose is offline Offline
2,413 posts
since Dec 2004
May 4th, 2005
0

Re: Wait/Pause Application before next process.

Hi,
Whats the ,0,1 used for?
Reputation Points: 24
Solved Threads: 6
Junior Poster in Training
purplegerbil is offline Offline
78 posts
since Apr 2005
May 4th, 2005
0

Re: Wait/Pause Application before next process.

0, makes it hide the window, so that it doesn't show up to the user (otherwise, they'd get some stupid dos window).
1, makes the Run Method of the WSH Object wait until the spawning process completes, before continuing on.
Team Colleague
Reputation Points: 361
Solved Threads: 214
Taboo Programmer
Comatose is offline Offline
2,413 posts
since Dec 2004
May 4th, 2005
0

Re: Wait/Pause Application before next process.

Works like a dream.

Thanks
Reputation Points: 24
Solved Threads: 6
Junior Poster in Training
purplegerbil is offline Offline
78 posts
since Apr 2005
May 4th, 2005
0

Re: Wait/Pause Application before next process.

Good Stuff.
Team Colleague
Reputation Points: 361
Solved Threads: 214
Taboo Programmer
Comatose is offline Offline
2,413 posts
since Dec 2004

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Basic Question
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Printer Object Question





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC