VB running too fast for WZZIP ? (1 Viewer)

bodhran1

Dazed and Confused
Local time
Today, 13:40
Joined
Mar 27, 2002
Messages
43
I am using WZZIP command line to zip up a bunch of files from within VB.

It appears to run fine, but when I open the ZIP file, there are files missing and it differs which files are missing each time I run it.

I put in a loop to slow it down and that seems to work, but it also defeats the purpose of the program.

Anyone else experience this problem?

Anyone have any ideas to try?


Thanks in advance,

Dave

:confused:
 

WayneRyan

AWF VIP
Local time
Today, 18:40
Joined
Nov 19, 2002
Messages
7,122
Dave,

Are you using the Shell command to launch ZIP?

If so, there is a chance that your VBA code is continuing
before the ZIP action has finished.

There have been several posts regarding waiting for the
Shell command to finish before continuing. Use the search
facility here.

Wayne
 

bodhran1

Dazed and Confused
Local time
Today, 13:40
Joined
Mar 27, 2002
Messages
43
Thanks Wayne,

I had tried the search engine before posting but had no luck. If you come across any, please forward the link to me. I tried a few other sites as well, with no luck.

Next I wrote to WINZIP tech help group. They said to use the command...

START /WAIT wzzip -a filename.zip @listfile.txt

I never heard of the START/WAIT command and couldn't find it in any manual.

I had added the statement "WAIT 1" after each one of my WZZIP commands and that seems to have helped.

I agree with you VB is getting ahead of WZZIP. It's a shame that we write stuff to speed up these kinds of things only to have to slow them down again.

Have you come across any other archiving methods that can keep up?

Thanks again for your help,

Dave
 

Travis

Registered User.
Local time
Today, 10:40
Joined
Dec 17, 1999
Messages
1,332
Have you tried using 'DoEvents' instead of a Loop?
 

intrep11

Registered User.
Local time
Today, 18:40
Joined
Apr 6, 2003
Messages
63
err help being a bit thick

Help

i have come accross the same problem and need some help

how do i use this ? with WZZIP

thanks
ND
 

bodhran1

Dazed and Confused
Local time
Today, 13:40
Joined
Mar 27, 2002
Messages
43
ND,

Here's a clip from my program.

It's an example of 2 things. First , it shows you the "Wait" command I used to delay the program one second which allows WZZIP to finish before starting the next section. Some sections I had to extend this to a 3 second delay.

Second it shows the syntax required for directories with spaces in the name.

I hope this helps. if you find a better way please pass it along. I don't like to build in delays. It seems to defeat the purpose of the program?

Call Shell ("C:\WINZIP81\WZZIP ""C:\Program Files\AutoCad LT 2000\projects\""" & Ascii.Text$ & "\" & Ascii.Text$ & revision + _ "acad.zip -A ""c:\Program Files\AutoCad LT 2000\projects\""" & Ascii.Text$ & "\" + _ Ascii.Text$ & revision & "asy.dwg ""c:\Program Files\AutoCad LT 2000\projects\""" & Ascii.Text$ & "\" & Ascii.Text$ &revision & "fab.dwg" ,)

Wait 1


Hope this helps!!

Dave
 

intrep11

Registered User.
Local time
Today, 18:40
Joined
Apr 6, 2003
Messages
63
thanks

thanks for that didnt realise you could just tell it to wait.

so you didnt use the code api shown

one other question i want to password protect the zip file using the -s[password] but i get an error

expected list separator or )

any suggestions as VB is totally new to me marcors i could do (ish)

ta
ND
 

bodhran1

Dazed and Confused
Local time
Today, 13:40
Joined
Mar 27, 2002
Messages
43
ND,

I'm a newbie too, and didn't understand the API code stuff. I went with the WAIT command becuase it was easier. ;-)

I just tried the password thing for the first time. I added the command -s[dave] after the -A command line as shown below.

I checked the ZIP file and it shows a + sign after each file and when I click on any file, it prompts me for the password. It appears to work fine.


Call Shell ("C:\WINZIP81\WZZIP C:\PADSPWR50\CAM\" & BoardNum & "\" & Ascii.Text$ & Revision & "dir.zip -A -s[dave]" + _
" c:\padspwr50\cam\" & BoardNum & "\605" & BdLast3 & "*.*" + _
" c:\padspwr50\cam\" & BoardNum & "\*.pho" + _
" c:\padspwr50\cam\" & BoardNum & "\drl01.*" + _
" c:\padspwr50\cam\" & BoardNum & "\*.pho" + _
" c:\padspwr50\cam\" & BoardNum & "\" & AsciiText$ & "*.*" + _
" c:\padspwr50\cam\" & BoardNum & "\*.rep" ,)
Wait 1

Let me know if I can help anymore. I'm glad that I can FINALLY return something to this group!

Dave
 

intrep11

Registered User.
Local time
Today, 18:40
Joined
Apr 6, 2003
Messages
63
ok

what the hell am i doing wrong now ?

this is my code

Call Shell ("C:\Program Files\Winzip\Wzzip -mf -s[eslnd1] c:\ES10\temp\ES10export.nd1 c:\ES10\temp\export.txt" ,)

and i am getting the error
compile error
expected:expression

er help ? as an alternative i can i suppose call a macro with the wzzip code in that but i dont want to admit defeat witht he target in my sights
 

intrep11

Registered User.
Local time
Today, 18:40
Joined
Apr 6, 2003
Messages
63
fixed

OK fixed that it was the , at the end causing the problem but i do get an error if i use wait 1

i get the error expected variable or procedure not module
 

bodhran1

Dazed and Confused
Local time
Today, 13:40
Joined
Mar 27, 2002
Messages
43
Did you put the WAIT 1 as a new line after the Shell line?

I'm not familiar with the -mf part of WZZIP. How does it know what to freshen, when you don't give it a file name to zip to?


Dave
 

intrep11

Registered User.
Local time
Today, 18:40
Joined
Apr 6, 2003
Messages
63
yes i did and it appears to be a vaild phrase until run time when you get the error and the debug mode

any suggestions ?

the wz commands follow this
Usage: wzzip [options] zipfile [@listfile] [files...]

in this case the zip file is es10export.nd1 (i just dont call it .zip so you have added security most users dont open wz first they double click on the zip file )

have to say though the - mf dosnt actually seem to work it is meant to delete the source file after it adds it the f part update or adds regardless of if the file alredy exists.
 

Users who are viewing this thread

Top Bottom