Link to home
Start Free TrialLog in
Avatar of mwoolger
mwoolger

asked on

Waiting for winzip to finish in batch file

Hi,
In a batch file i do a load of copy commands then call command line winzip to zip it all up before doing other stuff. The problem is that Winzip "appears to have completed" before it ACTUALLY has. ie it creates an empty zip file then puts stuff in it and returns focus to the calling batch file before it has "truly" finished.
The way in which it works means that i cant wait for the EXISTENCE of the winzip file before executing the next command in the file as it exists right from the start.

I could put an arbitrary wait time in but this is a little inexact, especially as the no. of files in the winzip file could vary between a low number and a high number and it seems silly to have the batch file sit around for 5 minutes just as an arbitrary "it must have completed in this time" sort of way.

SO: HOW do i get the next command in the batch file to hold fire until winzip has TRULY completed.
SOLUTION
Avatar of A Syscokid
A Syscokid

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mwoolger
mwoolger

ASKER

I can give that a try but my concern is that what is the difference between putting a command in a separate batch file and waiting for that to complete as apart to just having the line in the main batch file?

as a help, the full scenario is: from oracle plsql i kick off this batch file and need to check as to when it has finished. when it does i then do an operation which requires the file to be there and "completed". the problem is that any check i can think of (even taking a copy of the zip file) appears to plsql to have completed before it truly has.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Wzzip is what I am using. as it turns out its more of a problem in detecting when the batch file as a whole has finished. it seems to be working now that I have started using the C system function to start the batch file rather than starting it in a new thread. correspondingly i will split points between you all to be fair.
Why not use Good 'ol pkunzip.exe pkzip.exe they still work fine, anyone remember these?
It will run in the cmd/dos window and will run in order.