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.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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:\"
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.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.