Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

winzip command line problem

Status
Not open for further replies.

trinzul

IS-IT--Management
Feb 16, 2004
13
US

I wrote the following code to try to use VB.NET to zip a file using winzip's command line add-in. It seems to be opening a command window and running the wzzip.exe file, but it closes before the zip file is created. Does anyone have any suggestions as to how i can have it finish creating the file?

Thanks in advance,




Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim dump As Object
Dim MyString As String
MyString = MyString & "wzzip -rp y:\AMCC\test76.zip y:\AMCC\*.txt"
FileOpen(1, "C:\DOSText.txt", OpenMode.Output)
Print(1, MyString)
FileClose(1)
Dim sCmdLine As String
sCmdLine = "C:\Program Files\winzip\wzzip.exe " & "C:\DOSText.txt"
Call Shell(sCmdLine, AppWinStyle.NormalFocus, True, -1)
 
I don't have the syntax handy. But, the fact that the window closes early points to bad syntax/procedure in your command line. The window will close AFTER processing is complete; not early.

Check the usage of the asterix in this context: MyString = MyString & "wzzip -rp y:\AMCC\test76.zip y:\AMCC\*.txt"

It may be faulty.

Dimandja
 
Also, try keeping the ZIP file outside of y:\AMCC\. The alternative would be to zip one file at a time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top