How do you zip a folder using

Posted on 2010-11-09
Last Modified: 2012-05-10
Is there a way to do this without using a 3rd party application?

Question by:targunp

Expert Comment

ID: 34098357
Here is a way to zip using a Process:

    Private Sub srZip_CSV_File()
        'Zip RetailCustLineData.csv to and pause until completed before continuing
        Dim P As New Process
        P.StartInfo.FileName = "C:\Program Files\WinZip\WINZIP32.EXE"
        P.StartInfo.Arguments = "-min -a C:\FTP-Data\Icentrix\ C:\FTP-Data\Icentrix\RetailCustLineData.csv"
        ' ...continue with other stuff...
    End Sub

Expert Comment

ID: 34098372
Be sure to change this line to zip a folder:  (example)

P.StartInfo.Arguments = "-min -a C:\FTP-Data\Icentrix\<> C:\FTP-Data\Icentrix\*.*"

Change it to your names.
LVL 13

Expert Comment

ID: 34098414
There aren't any built-in .NET classes that handle ZIP compression. Also, the "built-in" zip compression for windows (Right click -> send to -> Compressed Folder) does not have a command line interface unless you've downloaded the MS support tool kit.

So, you will either need to download a 3rd party .NET zip library (such as - if you download the compiled assembly, it will work with a VB.NET application) or make a call to a 3rd party zip utility with a command line interface  (or Microsoft's COMPRESS utility, if you do have the support tools installed) using "Process.Start(executableFile, args)".
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

LVL 70

Expert Comment

by:Éric Moreau
ID: 34098780
LVL 14

Accepted Solution

raja_ind82 earned 500 total points
ID: 34099970

Author Comment

ID: 34160915
Google gzip, that is the best solution.

Author Closing Comment

ID: 34160921
Gzip is better, the example posted shows you how to pack a file, not pack and compress. Still thank you for your help

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How useful is the free version of Selenium? 3 31 help 4 28
Moving code from one TFS branch to another 3 25
cannot connect to sqlserver 8 25
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

813 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

18 Experts available now in Live!

Get 1:1 Help Now