• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 180
  • Last Modified:

Zipping Interface

Hi !!!!!!
First of All Very Very Happy New Year....
And HAve A Nice Time!!!!!
Cud you pls. do me a favor for giving me your precious time and kind attention for a while....

Here in my project ,I've a requirement of creating an Interface which will be able to
* The zipping of the files at leaves level as well as directory level....Thru VB program calling the command line utility supported by Zip or so.

Cud you pls. help me out in this regard...It'll be very nice of you if the source code I could get....I'm stuck with the kind of requirement the project has.
Any pointers towards this will be welcomed.

Thank you very much.
Chandra Shekhar.

  • 2
1 Solution
You can run PKZIP using the SHELL function (in VB), and pass it the appropriate command line arguments. The only problem you will have with PKZIP is that it is a DOS program and it will not support long filenames. It will compress files using their short filenames.
If the solution is OK and you need code, leave me a comment.
You can use some third party DLLs like XceedZip, DynaZip, etc.
See: http://www.xceedsoft.com/

ShekharSharmaAuthor Commented:
Thank you very much Kamal.....for your kind attention and for your excellent answer  ..Could you pls. get me the source code for the same you talked about ....It'll be very nice of you.....As you understand ,In the project ,some time it's very urgent to do the work as because of deadline .....Pls. bear with me....Thank you very much.
Chandra Shekhar.
You are welcome ShekharSharma.
To use PKZIP.EXE to compress files and folders, try this code:

Options = "-pr" 'Recurse directories
ZipFile = "c:\test.zip"
FilesToZip = "c:\sb16\*.*"
x = Shell("pkzip.exe" & " " & Options & " " & ZipFile & " " & FilesToZip, vbNormalFocus)

Be aware that short filenames and directory names are used in Win9x.
Also, PKZIP.EXE must be in directory which is declared in the PATH statement of your AUTOEXEC.BAT. Otherwise, give the full path in the command line string, like:

x = Shell("c:\mydir\pkzip.exe" & " " & Options & " " & ZipFile & " " & FilesToZip, vbNormalFocus)

Happy new year.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now