Jump to content
Sign in to follow this  

Using Windows Xp Zip Built-in Features

Recommended Posts


Is it possible through a dll call to use xp's zip feature to extract a zip file? with no user interaction if possible.

Share this post

Link to post
Share on other sites

That's for creating a zip file, right? :think: I already found that :( That's how actually this idea was born :)

Share this post

Link to post
Share on other sites

Following the same pattern as in http://www.autoitscript.com/forum/index.ph...pic=21004&st=0#, you could use something similar to:

Local $zipFile      = "C:\test.zip"
    Local $Destination  = "C:\test"
    Local $oShell = ObjCreate('Shell.Application')
    If @error or not IsObj($oShell) Then exit                   ;something went @#{[[~&^ç!
    Local $oFolder = $oShell.NameSpace($Destination)
    If @error or not IsObj($oFolder) Then exit                  ;something went @#{[[~&^ç!
    Local $zback = RegRead("HKLM\SOFTWARE\Classes\.zip", "")    ;Backup the .zip file handler
    If @error = 1 Then $zback = -1
    RegWrite("HKLM\SOFTWARE\Classes\.zip", "", "REG_SZ", "CompressedFolder");Let's recall to windows that zips are just zips
        Local $oZip = $oShell.NameSpace($zipFile)
        If @error or not IsObj($oZip) Then exit                 ;something went @#{[[~&^ç!
        Local $oItems = $oZip.Items()
        If @error or not IsObj($oItems) Then exit               ;something went @#{[[~&^ç! or .zip is empty
        For $o in $oItems                                       ;copy all the files 
            If Not IsObj($oFolder.ParseName($o.Name)) Then $oFolder.CopyHere($o); only the files not already existing
    If $zback = -1 Then     
        RegWrite("HKLM\SOFTWARE\Classes\.zip", "", "REG_SZ", $zback); restore the .zip file handler
Edited by Djé

Share this post

Link to post
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
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.