Wait/Pause Application before next process.

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Apr 2005
Posts: 75
Reputation: purplegerbil is an unknown quantity at this point 
Solved Threads: 6
purplegerbil's Avatar
purplegerbil purplegerbil is offline Offline
Junior Poster in Training

Wait/Pause Application before next process.

 
0
  #1
May 4th, 2005
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
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: Wait/Pause Application before next process.

 
0
  #2
May 4th, 2005
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
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 75
Reputation: purplegerbil is an unknown quantity at this point 
Solved Threads: 6
purplegerbil's Avatar
purplegerbil purplegerbil is offline Offline
Junior Poster in Training

Re: Wait/Pause Application before next process.

 
0
  #3
May 4th, 2005
Hi,
Whats the ,0,1 used for?
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: Wait/Pause Application before next process.

 
0
  #4
May 4th, 2005
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.
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 75
Reputation: purplegerbil is an unknown quantity at this point 
Solved Threads: 6
purplegerbil's Avatar
purplegerbil purplegerbil is offline Offline
Junior Poster in Training

Re: Wait/Pause Application before next process.

 
0
  #5
May 4th, 2005
Works like a dream.

Thanks
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: Wait/Pause Application before next process.

 
0
  #6
May 4th, 2005
Good Stuff.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum


Views: 11044 | Replies: 5
Thread Tools Search this Thread



Tag cloud for Visual Basic 4 / 5 / 6
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC