-
October 5th, 2005, 01:14 PM
#1
Zipping Folders
I am in need to zip folders using a VB6 app. I have the folders created but
I need to compress them into a zip file programically. Does anyone have any ideas on how to do this??
Thanks in advance for your help
Nate
-
October 5th, 2005, 01:26 PM
#2
Re: Zipping Folders
A search of CodeGuru would have turned up this gem.
How To Zip And Unzip In VB
-
October 5th, 2005, 01:27 PM
#3
Re: Zipping Folders
Thanks I should of searched first. I saw this a couple of min before you replied. Thanks again.
-
October 6th, 2005, 03:42 PM
#4
Re: Zipping Folders
This is a follow up to my early post. I am still having problems zipping folders. I can zip all files in a given dir but can not get sub folders to be included in the zip. Does anyone know what I am missing? Here is my code:
Dim oZip As CGZipFiles '
Set oZip = New CGZipFiles
oZip.ZipFileName = "C:\Temp\Request\MyZip.Zip"
oZip.AddFile "C:\Temp\Request\PR006454\*.*"
If oZip.MakeZipFile <> 0 Then
MsgBox oZip.GetLastMessage
End If
Set oZip = Nothing
-
October 6th, 2005, 07:12 PM
#5
Re: Zipping Folders
Originally Posted by Nate Hunter
This is a follow up to my early post. I am still having problems zipping folders. I can zip all files in a given dir but can not get sub folders to be included in the zip. Does anyone know what I am missing? Here is my code:
Dim oZip As CGZipFiles '
Set oZip = New CGZipFiles
'oZip.ZipFileName = "C:\Temp\Request\MyZip.Zip"
'oZip.AddFile "C:\Temp\Request\PR006454\*.*"
oZip.RecurseFolders = True
oZip.RootDirectory = "C:\Temp\Request\PR006454"
oZip.AddFile "*.*"
If oZip.MakeZipFile <> 0 Then
MsgBox oZip.GetLastMessage
End If
Set oZip = Nothing
This should work when reading the notes in the documentation 'How to Zip and Unzip in VB'
( I have got it working if the directory is the App.path but still problems if oZip.RootDirectory isn't App.path )
Jonny Poet
Jonny Poet
To be Alive is depending on the willingsness to help others and also to permit others to help you. So lets be alive. !
Using Code Tags makes the difference: Code is easier to read, so its easier to help. Do it like this: [CODE] Put Your Code here [/code]
If anyone felt he has got help, show it in rating the post.
Also dont forget to set a post which is fully answered to 'resolved'. For more details look to FAQ's about Forum Usage. BTW I'm using Framework 3.5 and you ?
My latest articles :
Creating a Dockable Panel-Controlmanager Using C#, Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6 | Part 7
-
October 7th, 2005, 08:46 AM
#6
Re: Zipping Folders
thanks for the reply. You are right I can get the code posted previously to work with the App.path. I can use this but I would like to remove the app from the zip. I tried:
oZip.RemoveFile "Project1.exe"
with no luck. any Ideas how I can get this file out of my zip file.
Thanks again.
-
October 7th, 2005, 03:17 PM
#7
Re: Zipping Folders
Originally Posted by Nate Hunter
...to work with the App.path.
I'm frightened in between, that there are bugs in the dlls. Does anyone have or know where to get the original dlls for debug ? In the different notes regarding that articel you see exactly this problems coming up:
1) You Cannot delete.
2) If its given fullpath in oZip.AddFile fullpathstring then you cannot
add subdirectories to even when you set oZip.RecurseFolders = True
You have to use: oZip.RootDirectory in this case. But if doing so then
3) you didnt get zipped the folder you want, app.path files are zipped !
So the solution is : Lets get the dlls source and repair it. That should work, isn't it ?
Jonny Poet
To be Alive is depending on the willingsness to help others and also to permit others to help you. So lets be alive. !
Using Code Tags makes the difference: Code is easier to read, so its easier to help. Do it like this: [CODE] Put Your Code here [/code]
If anyone felt he has got help, show it in rating the post.
Also dont forget to set a post which is fully answered to 'resolved'. For more details look to FAQ's about Forum Usage. BTW I'm using Framework 3.5 and you ?
My latest articles :
Creating a Dockable Panel-Controlmanager Using C#, Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6 | Part 7
-
November 21st, 2008, 10:31 AM
#8
Re: Zipping Folders
I had the same what an application I'm making. It is indeed not possible to zip the contents of another folder than the app.path folder. This is a bug, I presume?
The .RecurseFolders = True is working, but useless when only the application folder, including its subfolders, is zipped.
Please anuone who can repair this.
BTW, should the ZIP 3.0 beta do it better?
Regards,
Jaap
-
November 21st, 2008, 11:39 AM
#9
Re: Zipping Folders
As far as I know, the CGZip and CGUnzip classes base on the dlls Zip32.dll and Unzip32.dll
Personally I have used Unzip32.dll but had written an own wrapper function 'cause I didn't need all that class overhead. I found the dll itself working without errors.
Since you can get the source of the wrapper classes, you should study this and determine if the errors are produced in the VB-class or if they reside in the dll Zip32.dll itself. The function Zip32.dll provides may seem a little complicated but perhaps it behaves alright if you call the Zip function directly.
-
November 21st, 2008, 05:11 PM
#10
Re: Zipping Folders
Windows XP zips by default, plus you can make a zip file yourself. Download a Microsoft DOCX format file, and open it. It's a zip file as well.
-
November 21st, 2008, 10:10 PM
#11
Re: Zipping Folders
There is a link here on zipping files, have a look!
-
November 22nd, 2008, 04:27 AM
#12
Re: Zipping Folders
jagio, please do not revive old threads.
Rather start a new thread, and refer to the old thread.
-
November 23rd, 2008, 05:38 AM
#13
Re: Zipping Folders
Just stumbled into this, could be handy.
-
November 23rd, 2008, 11:35 AM
#14
Re: Zipping Folders
Just make sure you saw this:
'Apparently you can only shell WinZip in vbHide mode if you have licensed
'WinZip. If you are using the evaluation version, you need to run the shell in
'vbNormalFocus mode. Then WinZip displays a message saying it is running in
'evaluation mode and you must press a key to continue.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|