Welcome Guest.   Make a donation to an author on the site September 18, 2014, 10:45:28 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
Free DonationCoder.com Member Kit: Submit Request.
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: DONE: Req: (Autohotkey script ): auto unzip zip files in a folder recursively ?  (Read 11438 times)
jity2
Charter Member
***
Posts: 69

View Profile Give some DonationCredits to this forum member
« on: January 19, 2010, 01:31:48 PM »

Hello,

I would like to unzip any zip files contained in a folder, and its subfolders, and its subfolders and....
I was using the freeware unziplify but it does not seem to work well anymore on my computers (xp or vista). It falsely says that my zip file is corrupt even if atfer some test Winrar and 7-zip software say everything is fine.

I am using an Autohotkey script which does the zipping with Winrar command line software perfectly but could anyone help me do the unzipping ?
Here is a 2006 old thread which explains how I still do the zipping :
http://www.donationcoder....um/index.php?topic=4657.0

I guess it may be possible to use an Autohotkey script using the Winrar command line software (so like that I would be aware of unzipping errors) but I am open to any other suggestions.

Many thanks in advance Wink
« Last Edit: January 19, 2010, 01:33:59 PM by jity2 » Logged
skwire
Moderator
*****
Posts: 4,073



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #1 on: January 19, 2010, 02:44:23 PM »

This would be a piece of cake to write in AHK using unrar.exe.  I envision this having two fields and button:

1) Source folder.
2) Destination folder.
3) Button to initiate the unzipping.

Also, one would have to use the option to unzip each archive to its own folder.  Would you agree?

Logged

jity2
Charter Member
***
Posts: 69

View Profile Give some DonationCredits to this forum member
« Reply #2 on: January 19, 2010, 03:06:48 PM »

Hello,

I like your suggestion skwire. Wink

Thanks in advance Wink
Logged
skwire
Moderator
*****
Posts: 4,073



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #3 on: January 19, 2010, 03:14:02 PM »

So, are you going to give it a shot or would you like me to write it?
Logged

jity2
Charter Member
***
Posts: 69

View Profile Give some DonationCredits to this forum member
« Reply #4 on: January 19, 2010, 03:42:39 PM »

Hello skwire,
 I would much prefer if you could do it for me as I have no clue at how to do that !
Thanks in advance Wink
Logged
skwire
Moderator
*****
Posts: 4,073



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #5 on: January 19, 2010, 05:20:07 PM »

Give this a try (source/binary included): Download



1) Unpack that to a folder and run RecurUnZip.exe (or RecurUnZip.ahk if you have AutoHotkey installed).
2) Select a source and destination folder.
3) Click the "Unpack files" button.

Let me know how it works for you.  Thanks.
Logged

jity2
Charter Member
***
Posts: 69

View Profile Give some DonationCredits to this forum member
« Reply #6 on: January 20, 2010, 01:50:10 AM »

Good morning skwire,

Many thanks for your fast answers and help. Wink

I did some tests under Vista. Alas they were not all successful, I keep getting the following error : "The following files had problems extracting:".

By luck could you also add such options :
- if unzip successful, delete the zip file
- if errors, it does not display the list of the kind of errors the program has met (example: in zip file try01.zip, the files glop001.html and gyeop.htm are in error)!
- I don't know if this could help but I had the following options set up in unziplify (see image )

I am not sure, but I assume that if the last folder (which contains a zip file) has a space in its name, it is causing an error (it also could be some accents "e" instead of "é" or some several "." or other special ";"... in a file name inside a zip file).
Maybe some bugs might be due to the file IZARCE.exe ? I know that previously there were some errors with other zip command line programs (ex: Powerarchiver see http://www.donationcoder....um/index.php?topic=4657.0), but not in Winrar command line...

Example: I used spinzip (great program !) to create 10Mb zip files (with compression = 5) in folder "1 OT1", it worked without errors and created 17 zip files. Wink
Then I used "RecurUnZip.ahk" and asked to unpack files in the same folder and got errors (see image "iz" below. All the subfolders have been created but they are empty)

I am doing to test also in xp and let you know if I have the same problems.
Many thanks in advance Wink


* unzi ScreenShot00973.png (14.9 KB, 298x403 - viewed 357 times.)

* iz ScreenShot00974.png (20.6 KB, 289x463 - viewed 314 times.)
« Last Edit: January 20, 2010, 02:38:52 AM by jity2 » Logged
skwire
Moderator
*****
Posts: 4,073



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #7 on: January 20, 2010, 03:31:19 AM »

I did some tests under Vista. Alas they were not all successful, I keep getting the following error : "The following files had problems extracting:".

Hmmm...was it not listing the zip files it had problems with?  Did it unzip anything successfully?

Example: I used spinzip (great program !) to create 10Mb zip files (with compression = 5) in folder "1 OT1", it worked without errors and created 17 zip files. Wink
Then I used "RecurUnZip.ahk" and asked to unpack files in the same folder and got errors (see image "iz" below. All the subfolders have been created but they are empty)

That is odd.  I just did the same test with SpinZip and RecurUnZip...and both worked perfectly.
Logged

jity2
Charter Member
***
Posts: 69

View Profile Give some DonationCredits to this forum member
« Reply #8 on: January 20, 2010, 04:53:45 AM »

Hello skwire,

Thank you for your fast answer. I appreciated. Wink

Here are more tests under Vista (C:\ is formated in NTFS). I hope this help. Wink


Example 01:
If I use 7-zip.exe

Folder to be zipped:
C:\Users\jity1234\Desktop\1234567\0 1234567 dec09\1 OT1\
result
C:\Users\jity1234\Desktop\1234567\0 1234567 dec09\1 OT1\1 OT1.zip

zipping is ok and has no error.

if I unzip 1 OT1.zip in the folder
C:\Users\jity1234\Desktop\1234567\0 1234567 dec09\1 OT1\super01\
Result
C:\Users\jity1234\Desktop\1234567\0 1234567 dec09\1 OT1\1 OT1\then_the_files_unzipped_here

unzipping is ok and has no error.


Example 02:
If I use SpinZip for zipping = no errors.
But with RecurUnZip, errors displayed



Example 03:
Same than with example 01, but with winrar zipping in .zip
No error in zipping
but, errors in unzipping :
---
!   C:\Users\jity1234\Desktop\1234567\0 1234567 dec09\1 OT1\1 OT1.zip: Cannot create 1 OT1\efl_infoEF38706-des-le-premier-1245-de-1234567-les-1234-123456-12345678es-subiront-12-1-de-12345678ents-en-2010_20091214_144224_files\1931275723x50TopTop2Top3x01Middle3Middle4Middle5LeftLeft1Bott.js
    Total path and file name length must not exceed 260 characters
!   Le chemin d'acc√®s sp√©cifi√© est introuvable. [means : The specified path was not found.]

...etc...
---
It seems normal as the file has 285 characters.



Example 04:
so I have some problems in my original not_zipped folder.
I have moved it to C:\essai\1 OT1\ with the freeware Supercopier2 ( http://supercopier.sfxtea...org/?q=node/type/download can detect errors in filenames apparently). The size in octet and number of folders and files are the same in both unzipped 1 OT1 folders.

If i use Winrar
Folder to be zipped (extract to : .zip everything else are the default options):
C:\essai\1 OT1\
result
C:\essai\1 OT1\1 OT1.zip
ok with no errors

if I copy and unzip 1 OT1.zip in the folder
C:\essa2\1 OT1.zip
Result
C:\essa2\1 OT1\1 OT1\then_there_all_the_files

Please notice the second same folder.

The size in octets and the files number is the same, but there is one more folder (the second "1 OT1").
If I check the properties directly inside C:\essa2\1 OT1\, the properties are exactly the same.
So the work has been done properly. Wink

But when I delete manually the unzipped folder (1 OT1), I have a Windows error message:
"It is not possible to put some elements which have a too long name in the bin, do you want to delete the folder permanently ?"
I choose yes and I see the green bar becoming red during 2 seconds then it finish the job in green properly.
I don't think that this problem is really important !
If I test the folder C:\essai\1 OT1\ with LongFile.exe (freeware http://www.dcsoft.com/products/longff/longff.htm )
I have diplayed the files that have more than 100 characters (please see the image :

 ).

Even if I add the 15 characters of "C:\essai\1 OT1\" , I still have to understand why I have the windows long file name error. Anyway, thanks in advance if anyone knows why. Wink



Example 05:
same beginning than example 1 but I copy and unzip the zipped file in the folder C:\essa2\  with winrar
I have the same ok result than in example 4.




So, I am a little confused right now. Maybe before zipping I should process some kind of test ?? :
check if files inside folders have more than 100 (better than 260 characters limit as folder is not included in the test I assume), if yes rename automatically to 50 characters ?
As I save a lot of html pages, the renaming should rename both the htm (or html) file and its related folder, so I could be able to open such kind of files properly in the future. Wink
Then, finally doing the zipping. Wink

Many thanks in advance Wink

« Last Edit: January 20, 2010, 05:16:34 AM by jity2 » Logged
skwire
Moderator
*****
Posts: 4,073



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #9 on: January 20, 2010, 05:29:30 AM »

I appreciate all of the testing you've done.  Based off of what I see, would you like me to switch to the 7-zip.exe?  It seems that one gave you the fewest problems.
Logged

jity2
Charter Member
***
Posts: 69

View Profile Give some DonationCredits to this forum member
« Reply #10 on: January 20, 2010, 07:26:27 AM »

Hello skwire,

My pleasure. Wink Thank you to you! Wink
I agree with your suggestion as with example 1 (7-zip) the octets size are the same in both unzipped folders located inside the long path.

Thanks in advance Wink
Logged
jity2
Charter Member
***
Posts: 69

View Profile Give some DonationCredits to this forum member
« Reply #11 on: January 20, 2010, 08:11:09 AM »

more details for example 2:

Example 02:
Quote
If I use SpinZip for zipping = no errors.
By luck, could you make the default compression number being 5 (= I assume it is normal compression) ? Or may I be able to change that in the .ini file ?


Quote
But with RecurUnZip, errors displayed
And the folder created is void (unzipping was really too fast!). I assume it is because RecurUnZip uses IZARCE internally.
Moreover I am just noticed that this time 3 empty folders (0,1,2) were created in C:\Users\jity\Desktop\RecurUnZip  !

Thanks in advance Wink
Logged
skwire
Moderator
*****
Posts: 4,073



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #12 on: January 20, 2010, 09:03:35 AM »

Here's the 7-zip version: Download

Let me know if that works out better for you.
Logged

jity2
Charter Member
***
Posts: 69

View Profile Give some DonationCredits to this forum member
« Reply #13 on: January 20, 2010, 09:38:38 AM »

Hello again skwire !;)

Thank you very much for your great help. Wink

If I do : example 1, it is working fine. Same octet size. wow! Wink

(For information: If I do first the zipping with  Spinzip (izarc.exe), the unzipped size is slighlty different than the original (1Mo / 177Mo about 35 files missing))


note: see image for current path


I have to do more tests with 2 other problematic folders and let you know how it turns out. And test on xp.

Thanks again Wink


* path ScreenShot00987.png (16.58 KB, 485x144 - viewed 290 times.)
Logged
skwire
Moderator
*****
Posts: 4,073



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #14 on: January 20, 2010, 09:47:23 AM »

Doh, I re-upped the archive without my test paths in it.  Je suis vraiment d√©sol√©.
Logged

jity2
Charter Member
***
Posts: 69

View Profile Give some DonationCredits to this forum member
« Reply #15 on: January 20, 2010, 10:24:54 AM »

No problem skwire Wink
Thank you Wink

I did more tests with 2 other problematic folders on vista and it worked fine Wink

I did other tests on xp (will do them on vista later) and RecurUnZip is working fine again. Wink

I have just found one bug (I don't think it is xp related!) :
In the folder : H:\1_123_u\2009\Mebo07-10_2009  I have two subfolders (and nothing else) :
H:\1_123_u\2009\Mebo07-10_2009\Mebo09_2009
 and
H:\1_123_u\2009\Mebo07-10_2009\Mebo10_2009

Both these subfolders contain one or more zip file(s). example :
H:\1_123_u\2009\Mebo07-10_2009\Mebo09_2009\exa01.zip
...etc

When I use RecurUnZip and give him the same folder : H:\1_123_u\2009\Mebo07-10_2009
alas it unzip the zip file here:
H:\1_123_u\2009\Mebo07-10_2009\
but not here:
H:\1_123_u\2009\Mebo07-10_2009\Mebo09_2009\exa01\
...

Thanks in advance Wink
Logged
jity2
Charter Member
***
Posts: 69

View Profile Give some DonationCredits to this forum member
« Reply #16 on: January 21, 2010, 07:12:41 AM »

Hello,

After much more tests all this morning, here is what I have found :

Vista
If I use 7-zip for zipping and the last RecurUnZip version (using 7-zip fo runzipping), it works great (same size octets & same files numbers). Wink
The only small problem being that there may be some problems when later one wants to delete files [path+filenames] longer than 260 characters.
Solutions (*): go one parent folder before and rename the folder with a shorter name and it should delete the folder and the longname file inside.
( (**) this seems normal as since 2007: "7-Zip now supports file pathnames longer than 260 characters."
http://209.85.229.132/sea...n&ct=clnk&client=)

Xp
If I use 7-zip for zipping (done under vista), and unzipping in XP the last RecurUnZip version (using 7-zip fo runzipping),it works ok.
But is it not working fine for [path+filenames] that have more than 260 characters (i.e. the 3 folders were I had problems originally with unziplify and winrar). The files seems properly unzipped but are not exactly of the same octet size and not really accessible in the Xp explorer.
The solution I have found is to:

Use this freeware (I have tried many others but they failed under vista!):
Pathscanner (http://www.parhelia-tools...hscanner/PathScanner.aspx) and list files that are longer than 260 characters.

Tip: Pease note that it is better to know in advance where the zip file will be unzipped and how long that path will be!

Personal example :
I zip this folder (folder path = 56 characters)
C:\Users\jity1234\Desktop\1234567\0 1234567 dec09\1 OT1\
which gives this file :
C:\Users\jity1234\Desktop\1234567\0 1234567 dec09\1 OT1\1 OT1.zip


But when I unzip the zip file I use into another place: ( folder path = 32 characters)
H:\archive\2009\0 1234567 dec09\1 OT1.zip
it gives :
H:\archive\2009\0 1234567 dec09\1 OT1\[unzipped_files_here]  ( folder path = 38 characters)


So there is a difference of 18 (56-38) characters less in my destination folder of the unzipped file than the original folder.
I have to keep in mind this when I check the path characters number before zipping the original folder.
In my case : 278 characters (260 Vista limit + 18 of difference) limit should be fine. Wink
So I rename and/or save text copy of files (usually html files in my case) in my original folder before zipping.
 

I hope this helps and thanks in advance to skwire. Wink



(*) other possibilities:
- http://ccollomb.free.fr/unlocker/
- rigth click on the folder, uncheck "read only". Then, click on "advanced" and check "ready to be archived" and "compress what is inside" (sorry rough translation from french!)

(**) more infos on this 260 characters limit
http://www.windowsreferen...r-limitations-in-windows/
http://stackoverflow.com/...ngth-in-ntfs-xp-and-vista
http://stackoverflow.com/...-more-than-260-characters
http://msdn.microsoft.com.../aa365247%28VS.85%29.aspx
http://www.codinghorror.c...blog/archives/000729.html
Logged
skwire
Moderator
*****
Posts: 4,073



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #17 on: January 21, 2010, 11:26:17 PM »

So, jity2, can we call this Coding Snack completed?
Logged

jity2
Charter Member
***
Posts: 69

View Profile Give some DonationCredits to this forum member
« Reply #18 on: January 22, 2010, 12:03:09 PM »

Hello skwire,

Quote
So, jity2, can we call this Coding Snack completed?

Short answer: yes ! Wink


Long answer (in case it may help other persons) :
With "path scanner" I use the 273 limit (= 278 - (260-255)) as vista limit is 260 and xp limit is 255 !



*
Unziplify found a new kind of bug ("the file seems to be corrupt") as there was 4 htm files with this size:
.htm 1ko
related folder 1Mo

When I checked the .htm in firefox, not everything has been saved properly (firefox loaded the missing info from the internet).

note: all the 4 htm files (and related folders) had names starting with "www." ! May be a bug in Firefox ? I try to repeat this firefox but this time everything was saved properly!  huh


*
Another error found ("the file seems to be corrupt") by unziplify :
Inside the related folder on one html file, there was a tiny file that vista could not have access to.
Solution: save the text and deleted .htm and related folder.




*
I have use the freeware "CSDiff 5" (http://download.cnet.com/...3000-2248_4-10009023.html) so I could find the what was the missing file in the case just above.
To my surprise, I have found a real (small) bug in unziplify :
If there is
" ' "
 or
" << "
or
" " "
 (spaces not included) in the [.htm + related folder] name unziplify transform into strange characters.
note: the folder size in octet and file number is exactly the same !  huh
Hopefully I can still load the html file in firefox and read the text correctly. The only problem being that images contained inside the related folder are not loaded in firefox but can be openned manually in the explorer. Wink


Many thanks again for your help Wink
Logged
nkormanik
Participant
*
Posts: 284

View Profile Give some DonationCredits to this forum member
« Reply #19 on: August 28, 2014, 03:21:47 AM »

Slightly different request, Skwire....  Instead of asking for a destination folder, and creating a different directory structure.

I would prefer that any archive simply be replaced with an unarchived folder, or the contents of the archive.  In place, in present directory structure.

This is what the old program unziplify did (no longer available, and apparently stopped working due to some Windows system upgrade).

What do you think?

Thanks!

Logged
jity2
Charter Member
***
Posts: 69

View Profile Give some DonationCredits to this forum member
« Reply #20 on: August 28, 2014, 03:29:58 AM »

Hi nkormanik,

I still use unziplify in windows 8.1 64bits. And it still works fine for me. Apparently you can find it here now :
http://unziplify.en.uptodown.com/

See ya Wink
Logged
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.055s | Server load: 0.16 ]