Sign in to follow this  
Followers 0
forger

Using Windows Xp Zip Built-in Features

5 posts in this topic

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

#5 ·  Posted (edited)

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
        Next
    If $zback = -1 Then     
        RegDelete("HKLM\SOFTWARE\Classes\.zip")
    Else
        RegWrite("HKLM\SOFTWARE\Classes\.zip", "", "REG_SZ", $zback); restore the .zip file handler
    EndIf
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  
Followers 0