Jump to content

Question For Batch Unzipping


Recommended Posts

Okay, I'm trying to write some batch script that will use the built in Windows file (de)compressor to unzip a folder and then install it. Is there anyway to do this? I know it has something to do with "rundll32.exe zipfldr.dll,<insert command here> '*.zip'", but after that I'm stuck!

What do I need to put in there to make it unzip? "RouteTheCall" just opens it in Explorer...

Link to comment
Share on other sites


Why are you making it so difficult, why don't you use built-in iexpress to do the job?

http://www.microsoft.com/technet/prodtechn...s.mspx?mfr=true

That's all very well and good, but you didn't answer my question, so I'm assuming that you don't know the answer either.

I looked at the .dll in depends.exe, and the only functions it supports are RouteTheCall, DllCanUnloadNow, DllGetClassObject, DllRegisterServer, DllUnregisterServer, and RegisterSendto, all except the first one are 'default' functions of .dll's.

With that being said, how the hell does it (un)zip folders? I don't get it.

Edited by PityOnU
Link to comment
Share on other sites

Opens zip file in explorer window:

rundll32 zipfldr.dll,RouteTheCall <FileName>

Repairs registry for SendTo Compressed folder context menu:

rundll32 zipfldr.dll,RegisterSendto

But zipfldr.dll is not used for compressing or uncompressing files natively in XP.

Shell32.dll is what is accessed when sending to a compressed folder or using the "extract all" context menu.

But if all you want to do is copy files out of the ZIP file use the copy command.

copy <myzip>\*.* <mydest>

where <myzip> is the name of the zip file without the extension and <mydest> is the location you wish the files extracted to.

I think that just leaves creating a compressed folder using XP's built in capabilities.

Link to comment
Share on other sites

Opens zip file in explorer window:

rundll32 zipfldr.dll,RouteTheCall <FileName>

Repairs registry for SendTo Compressed folder context menu:

rundll32 zipfldr.dll,RegisterSendto

But zipfldr.dll is not used for compressing or uncompressing files natively in XP.

Shell32.dll is what is accessed when sending to a compressed folder or using the "extract all" context menu.

But if all you want to do is copy files out of the ZIP file use the copy command.

copy <myzip>\*.* <mydest>

where <myzip> is the name of the zip file without the extension and <mydest> is the location you wish the files extracted to.

I think that just leaves creating a compressed folder using XP's built in capabilities.

Thank you! That does help! I knew that Windows XP recognized .zip files as directories but I could never figure out how to get the stuff out of them...

Also, I was looking through my computer and I found a file called unzip.exe in my Windows directory. I accessed it via command (batch) and guess what? It worked! Unzipped the files perfectly!

However, as you said, finding out how XP zips the files is something entirely different it seems. I could not find a file called zip.exe, nor a file called zipit.exe, which I am told was the file that used to be used for compressing folders. I guess a little more research is needed...

Link to comment
Share on other sites

Not sure where your unzip.exe came form but it's not part of windows XP by default.

From watching the files accessed during compression and decompression using windows the only files accessed were explorer.exe, shell32.dll, and browseui.dll. So I believe all of the compressing and decompressing is performed by shell32.dll, and I'm assuming you use some additional switch value when making a folder to make it a compressed folder but I have yet to figure out which one.

I also discovered that the header for a ZIP file is what is contained in the registry key for creating a new compressed folder. So it may be that shell32 is just being used to write a file with that header information in it.

Link to comment
Share on other sites

Opens zip file in explorer window:

rundll32 zipfldr.dll,RouteTheCall <FileName>

Repairs registry for SendTo Compressed folder context menu:

rundll32 zipfldr.dll,RegisterSendto

But zipfldr.dll is not used for compressing or uncompressing files natively in XP.

Shell32.dll is what is accessed when sending to a compressed folder or using the "extract all" context menu.

But if all you want to do is copy files out of the ZIP file use the copy command.

copy <myzip>\*.* <mydest>

where <myzip> is the name of the zip file without the extension and <mydest> is the location you wish the files extracted to.

I think that just leaves creating a compressed folder using XP's built in capabilities.

You must have some special extensions installed that allow the COPY command to work with zip folders.

I've tried the copy command on XP Pro and Server 2003 R2 and it does not work.

I created a zipped folder called foo.zip and put some files in it

Next, I created a normal folder called myfoo.

C:\copy foo.zip\*.* myfoo

The system cannot find the path specified.

I'm trying to use a batch script to unzip files as well.

I guess I'll just have to download and include a free unzip command line util. It seems odd that there's no way to do this natively within XP/Server 2003.

Link to comment
Share on other sites

But if all you want to do is copy files out of the ZIP file use the copy command.

copy <myzip>\*.* <mydest>

where <myzip> is the name of the zip file without the extension and <mydest> is the location you wish the files extracted to.

don't add the extension:

C:\copy foo.zip\*.* myfoo

should be

C:\copy foo\*.* myfoo

Link to comment
Share on other sites

But if all you want to do is copy files out of the ZIP file use the copy command.

copy <myzip>\*.* <mydest>

where <myzip> is the name of the zip file without the extension and <mydest> is the location you wish the files extracted to.

don't add the extension:

C:\copy foo.zip\*.* myfoo

should be

C:\copy foo\*.* myfoo

Yeah, I had tried that, too. No luck.

I can type foo.zip by itself - it opens in the explorer window of course.

Are you sure you don't have some virtual folder extension installed? Or perhaps a cmd.exe replacement that has native zip support?

I thought that there might be a command line switch for cmd that would enable zip support, but I haven't found any.

Thanks for the fast reply.

Link to comment
Share on other sites

:huh: ok now this is weird. :blink: It worked great for me when I posted it, tested it multiple times on two different machines. Now I can't get it to work. :wacko:

That is weird. Try logging out and logging back in, or even rebooting.

Link to comment
Share on other sites

That's the only thing I have done since I did it was reboot.

I wonder if re-registering the zipfldr.dll or some other dll broke it.

Do you have other zip utils installed?

Thanks for your efforts. I hope you get it to work again.

Link to comment
Share on other sites

Wow, this is turning out to be really weird :/ Doesn't work for me now either

Do any of you guys want me to post the unzip.exe I found in my windows directory? If you use .exe compilers for your batch, you would be able to include it with them.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...