Solved

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

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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…

724 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