Solved

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

Posted on 1997-05-28
2
415 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

756 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