469,282 Members | 2,034 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,282 developers. It's quick & easy.

Zip files using the Compressed Folders functionality in Windows

Hi,

I need to write a small Windows application (console or forms) (for Windows
XP SP2 & Windows Server 2003), which will check a folder for the presence of
some files, and if they exist, it will zip the files using the inbuilt
Compressed files functionality of Windows (same as the Context Menu -Send to
-Compressed (zipped) folder).

I cannot use any other third party tool (like winzip etc.) because of some
non-technical constraints.

However, I have not been able to figure out how use the zip functionality.
Do I need to call "zipfldr.dll" (in system32 folder) or is there another
way
to do it?

Thanks,
Mayank

Nov 5 '06 #1
11 10314
MadMonk <Ma*****@discussions.microsoft.comwrote:
I need to write a small Windows application (console or forms) (for Windows
XP SP2 & Windows Server 2003), which will check a folder for the presence of
some files, and if they exist, it will zip the files using the inbuilt
Compressed files functionality of Windows (same as the Context Menu -Send to
-Compressed (zipped) folder).

I cannot use any other third party tool (like winzip etc.) because of some
non-technical constraints.

However, I have not been able to figure out how use the zip functionality.
Do I need to call "zipfldr.dll" (in system32 folder) or is there another
way to do it?
Could you tell us exactly what the non-technical constraints are? The
normal solution would be to use CSharpZipLib, a free managed zip API -
but without knowing the details of your constraints, we can't know
whether or not that's an option.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Nov 5 '06 #2
Hi Jon,

My client doesn't want any "third-party" applications/dlls/libraries
installed on the (production environment) server where this app would run.
Also, another of their objections (which seems valid to me) is, "If Windows
has the inbuilt capability to zip/unzip files, why do we need to install/use
third party code to achieve the same functionality?"

I know that the above might be debatable, but these are the constraints I'm
facing....

Thanks,
MadMonk

"Jon Skeet [C# MVP]" wrote:
MadMonk <Ma*****@discussions.microsoft.comwrote:
I need to write a small Windows application (console or forms) (for Windows
XP SP2 & Windows Server 2003), which will check a folder for the presence of
some files, and if they exist, it will zip the files using the inbuilt
Compressed files functionality of Windows (same as the Context Menu -Send to
-Compressed (zipped) folder).

I cannot use any other third party tool (like winzip etc.) because of some
non-technical constraints.

However, I have not been able to figure out how use the zip functionality.
Do I need to call "zipfldr.dll" (in system32 folder) or is there another
way to do it?

Could you tell us exactly what the non-technical constraints are? The
normal solution would be to use CSharpZipLib, a free managed zip API -
but without knowing the details of your constraints, we can't know
whether or not that's an option.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Nov 5 '06 #3
"MadMonk" <Ma*****@discussions.microsoft.comwrote in message
news:FC**********************************@microsof t.com...
My client doesn't want any "third-party" applications/dlls/libraries
installed on the (production environment) server where this app would
run.
That's my type of client! My normal response to that is "Let me use the
3rd-party utility which I've used 100 times before and you can have your app
at the end of the week, otherwise it'll take me an extra couple of weeks
possibly more to develop exactly the same thing myself."
Nov 6 '06 #4
We've seen this before... usually from "sensitive" environments (gov,
mil, etc)

Try:
http://www.codeproject.com/csharp/de...shellapics.asp

Marc

Nov 6 '06 #5
Hi,
My client doesn't want any "third-party" applications/dlls/libraries
installed on the (production environment) server where this app
would run. Also, another of their objections (which seems valid to
me) is, "If Windows has the inbuilt capability to zip/unzip files,
why do we need to install/use third party code to achieve the same
functionality?"
Just to add what to the others are saying, if you can get your users to
install .NET 3.0, you can use:
http://windowssdk.msdn.microsoft.com...io.packaging.a
spx

Or, if you can install VJ# runtime, you can use
http://msdn.microsoft.com/msdnmag/is...ion/default.as
px

Myself, I don't understand how a functionality like zipping wasn't
there from .NET 1.0, but that is life :)

Regards,
Adrian.
Nov 6 '06 #6
Interesting. I will happily revise my previous answer to say that this is
the way to go *when* 3.0 is RTM - which should hopefully make this a
non-issue for anything currently only in development.

Now all I have to do is find a comprehensive list of all the new classes in
3.0 ;-p

Marc
Nov 6 '06 #7
The Java zipfile classes are undocumented in .NET 2.0, so you will need to
search for documentation on how to use them. They are actually pretty easy
to use, however.

Mike Ober.

"Adrian Gallero" <adrian@[nospam]tmssoftware.comwrote in message
news:O8**************@TK2MSFTNGP02.phx.gbl...
Hi,
>My client doesn't want any "third-party" applications/dlls/libraries
installed on the (production environment) server where this app
would run. Also, another of their objections (which seems valid to
me) is, "If Windows has the inbuilt capability to zip/unzip files,
why do we need to install/use third party code to achieve the same
functionality?"

Just to add what to the others are saying, if you can get your users to
install .NET 3.0, you can use:
http://windowssdk.msdn.microsoft.com...io.packaging.a
spx

Or, if you can install VJ# runtime, you can use
http://msdn.microsoft.com/msdnmag/is...ion/default.as
px

Myself, I don't understand how a functionality like zipping wasn't
there from .NET 1.0, but that is life :)

Regards,
Adrian.

Nov 6 '06 #8
Thus wrote Michael,
The Java zipfile classes are undocumented in .NET 2.0, so you will
need to search for documentation on how to use them. They are
actually pretty easy to use, however.
You can use Sun's JDK docs for that.

Cheers,
--
Joerg Jooss
ne********@joergjooss.de
Nov 6 '06 #9
Hi Mac,
Interesting. I will happily revise my previous answer to say that
this is the way to go when 3.0 is RTM
Well, it looks you didn't had to wait *that* much ;)
(see the "ANN: .NET 3.0 Final" thread for more information, or
go to
http://www.microsoft.com/downloads/d...0cc340b-f857-4
a14-83f5-25634c3bf043&displaylang=en
)

Regards,
Adrian.

Nov 7 '06 #10
I already saw it and installed ta ;-p

Now to get it working...

Marc
Nov 7 '06 #11
Thanks a lot everyone for your replies. This gives me a couple of options to
explore, namely .NET 3.0 & the link sent by Marc Gravell.

MadMonk

"Joerg Jooss" wrote:
Thus wrote Michael,
The Java zipfile classes are undocumented in .NET 2.0, so you will
need to search for documentation on how to use them. They are
actually pretty easy to use, however.

You can use Sun's JDK docs for that.

Cheers,
--
Joerg Jooss
ne********@joergjooss.de
Nov 7 '06 #12

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Chuck Anderson | last post: by
2 posts views Thread by Glen | last post: by
2 posts views Thread by Nathan | last post: by
3 posts views Thread by ILMergeHelp | last post: by
10 posts views Thread by Martin Ho | last post: by
3 posts views Thread by Kimera.Kimera | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.