Solved

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

Posted on 1997-05-28
2
410 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

706 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now