Solved

Unzip a file in VB code without pkunzip....

Posted on 1997-05-28
2
414 Views
Last Modified: 2010-05-18
I have to unzip a file in Visual Basic 4.0
How can I do that?
0
Comment
Question by:yello
2 Comments
 
LVL 2

Accepted Solution

by:
vorlon earned 50 total points
ID: 1426605
Yello,
Here's a way that I use and might work for you. It might work because I'm using vb3. The principal for vb4 should be identical.

What I do is I create a pif file that actually calls the pkunzip dos command. I set the pif file to run minimized, without focus and to terminate as soon as the pkunzip command is done. Form the  vb code just shell out the pif filename like this:

Sub Form_Click ()
    Dim x As Integer
    x = Shell("c:\myfiles\myunzip.pif c:\ziplib\file1.zip c:\temp", 6)
End Sub

Here, the 6 is redundant since the pif file is already setup to run minimized.

The pif file is easy to create. Only 2 fields need to be entered: the program name (pkunzip.exe) and the program title (My Unzip, or something).

The string that gets passed to the shell command has the following structure:

command params

where command is the pif file, and params is the parameters passed to the pif file. In the example above:

c:\myfiles\myunzip.pif c:\ziplib\file1.zip c:\temp

the pif file will unzip file c:\ziplib\file1.zip into c:\temp.

Hope this helps
0
 
LVL 4

Expert Comment

by:Chizl
ID: 1426606
http://www.apexsc.com/vb/ftp/misc/addzip.zip

The addZIP Compression Libraries are powerful, easy-to-use, PKZIP-compatible compression APIs for Windows. They allow the developer to add PKZIP-functionality to their programs. Includes source code (VB3) for a drag-and-drop .ZIP file manager.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question