It provides a basic zip/unzip support in XP using the native ZipFolder support.
Naturally, the ZipFolder should be enabled for the script to work (regsvr32.exe /s zipfldr.dll).
The example in the script does:
zipping this script/CoHelper.ahk/FileHelper.ahk to script.zip in the temporary folder, then unzipping it in the temporary folder.
DOWNLOAD ZipFolder.ahk and CoHelper.ahk and FileHelper.ahk.
Zip/Unzip using native ZipFolder Feature in XP
Started by
Sean
, Jun 06 2007 02:53 AM
33 replies to this topic
#1
-
Posted 06 June 2007 - 02:53 AM
great work..
exactly what i was looking for..
but unzip does not seem to work! am i missing something?
exactly what i was looking for..
but unzip does not seem to work! am i missing something?
#2
-
Posted 17 May 2008 - 01:34 PM
If i've seen further it is by standing on the shoulders of giants
my site | ~shajul | WYSIWYG BBCode Editor
my site | ~shajul | WYSIWYG BBCode Editor
Yes.am i missing something?
Works fine here. What code are you using?
#3
-
Posted 17 May 2008 - 02:29 PM
Thanks for your prompt reply!
Works fine now! some bug in my system maybe
thanks again!
Works fine now! some bug in my system maybe
thanks again!
#4
-
Posted 17 May 2008 - 04:40 PM
If i've seen further it is by standing on the shoulders of giants
my site | ~shajul | WYSIWYG BBCode Editor
my site | ~shajul | WYSIWYG BBCode Editor
Wow!
8)
but, how the ... did I miss this excellent script? :shock:
8)
but, how the ... did I miss this excellent script? :shock:
Wed Jun 06, 2007
#5
-
Posted 17 May 2008 - 05:57 PM
Hello!
Apologies for barging in. I'm trying to find a simple, preferrably open-source solution to unpack a zip from within an ahk script - eventually a compiled script, more of an installer, that could be freely distributed.
Problem is, I need this to work in all Windows versions from Win95 to Vista, so relying on XP's built-in code is not an option. Could anyone kindly offer some tips in this regard? Thank you!
Apologies for barging in. I'm trying to find a simple, preferrably open-source solution to unpack a zip from within an ahk script - eventually a compiled script, more of an installer, that could be freely distributed.
Problem is, I need this to work in all Windows versions from Win95 to Vista, so relying on XP's built-in code is not an option. Could anyone kindly offer some tips in this regard? Thank you!
#6
-
Posted 11 August 2008 - 10:12 PM
Very useful, many thanks.
#8
-
Posted 13 August 2008 - 11:23 PM
Hi, is there anyway possible to have Password protection for the zip, for this process?
#9
-
Posted 10 December 2008 - 06:49 PM
Noticed since most of us have moved to COM stdlib, it may help someone looking for an updated version
Zip(sDir, sZip) { If Not FileExist(sZip) { VarSetCapacity(Header, 22, 0) Header := "PK" . Chr(5) . Chr(6) ReadMemory(sZip, &Header, 22) } psh := COM_ActiveXObject("Shell.Application") pzip := COM_Invoke(psh, "Namespace", sZip) COM_Invoke(pzip, "CopyHere", sDir, 4|16) Sleep, 1000 COM_Release(pzip) COM_Release(psh) } Unz(sZip, sUnz) { psh := COM_ActiveXObject("Shell.Application") pzip := COM_Invoke(psh, "Namespace", sZip) punz := COM_Invoke(psh, "Namespace", sUnz) pitms:= COM_Invoke(pzip, "Items") COM_Invoke(punz, "CopyHere", "+" . pitms, 4|16) Sleep, 1000 COM_Release(pitms) COM_Release(pzip) COM_Release(punz) COM_Release(psh) }
#10
-
Posted 03 February 2010 - 05:49 PM
Wow!
8)
but, how the ... did I miss this excellent script? :shock:Wed Jun 06, 2007
Likewise!
Thx sean and free radical
#11
-
Posted 04 February 2010 - 02:37 AM
Mhh, your version, sadly, doesn't work, Free Radical.
[quote]Function Name: "Namespace"
Error: The COM Object may not be a valid one![/quote]
Get the same error with "CopyHere".[/quote]
[quote]Function Name: "Namespace"
Error: The COM Object may not be a valid one![/quote]
Get the same error with "CopyHere".[/quote]
#12
-
Posted 04 February 2010 - 02:10 PM
I had the same problem and the reason was that path you want to extract in must exist, zip file must exist and be careful how you parse variable to the function. if you are having problems please post your script
#13
-
Posted 05 February 2010 - 12:07 PM
Mhh, your version, sadly, doesn't work, Free Radical.
Function Name: "Namespace"
Error: The COM Object may not be a valid one!
Get the same error with "CopyHere".
works for me :cry:
Still needs FileHelper.ahk.
Don't forget to #include it.
Also, the sDir must exist, so just use FileSelectFolder to create the folder to zip to, before calling the function,
or add it to the function.
#14
-
Posted 05 February 2010 - 01:25 PM
Full credit for re-writing these functions for AutoHotkey_L and COM_L goes to answer4u, I removed the Sleep commands as I believe they were related to the timing of the manual release of COM objects in the original, which is no longer necessary in COM_L:
Zip(sDir, sZip) { If Not FileExist(sZip) { VarSetCapacity(Header, 22, 0) Header := "PK" . Chr(5) . Chr(6) ReadMemory(sZip, &Header, 22) } COM_CreateObject( "Shell.Application" ).Namespace( sZip ).CopyHere( sDir, 4|16 ) } Unz(sZip, sUnz) { psh := COM_CreateObject("Shell.Application") psh.Namespace( sUnz ).CopyHere( psh.Namespace( sZip ).items, 4|16 ) }
#15
-
Posted 26 February 2010 - 06:30 PM