473,240 Members | 1,639 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,240 software developers and data experts.

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 10571
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: | last post by:
Hi, Does .NET have classes or in the near future have classes to allow me to compress N files into one or somehow contain N files in one (even without compression)? If .NET hasnt or wont,...
0
by: Chuck Anderson | last post by:
I am writing a Php script to run on my home PC (Windows) that downloads an Apache access log file and inserts new entries into a database.. The only way I can access these log files is through a...
2
by: Glen | last post by:
As I understand it, when the first page of an application is accessed, all ASPX/ASCX/etc. files in the same folder are compiled using the JIT compiler. Is there a way to turn this feature off? ...
2
by: Nathan | last post by:
I'd like to create a simple backup utility for myself, which would involve selecting a group of files and sending them to a compressed folder in WinXP. Can someone point me in the right direction...
3
by: ILMergeHelp | last post by:
Hi All, I have an application similar to windows explorer. The problem now is that am not able to sort the folders and files windows explorer style i.e. Ex All folders are sorted in alpha order...
10
by: Martin Ho | last post by:
I am running into one really big problem. I wrote a script in vb.net to make a copy of folders and subfolder to another destination: - in 'from.txt' I specify which folders to copy - in...
3
by: Kimera.Kimera | last post by:
I'm trying to write a program in VB.net 2003 that basically deletes all files, folders, sub-folders and sub-sub folders (etc). The program is simply for deleting the Windows/Temp folder contents,...
5
by: rogersw8n | last post by:
Some how, some way the account that creates folders under Temporary Internet files has been changed to a domain account for VS 2003 and VS 2005. I recently installed VS 2005. All seemed to be ok...
1
by: =?Utf-8?B?UmljaA==?= | last post by:
I am using a web browser control in my program for bringing up files/folders in Windows Explorer on a given user's workstatino -- searching special files/folders on the company server. This works...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.