Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AutoIt unzipping files

Tags:

zip

unzip

autoit

With AutoIt script I want to unzip a file. Does anyone know of a method?

like image 544
josh Avatar asked Dec 13 '25 23:12

josh


1 Answers

There are a lot of solutions people have coded. A few examples are the 7zip UDF, Zip.au3, zipfldr UDF. If those are not working for you it is most likely because of small changes to AutoIt, which is usually just #incudes being restructured.

I usually just keep 7za.exe (7-zip's standalone executable, 7-zip can be downloaded from here, and then after installing you can copy the 7za.exe from its program directory).

Then it becomes as simple as a call to RunWait to create the archive:

RunWait("7za.exe a MyNewArchive.zip file1.ext file2.ext ...")

And then to unzip:

RunWait('7za.exe x MyArchive.zip -o"Path\To\MyOutputFolder"')

The 7-zip FAQ also mentions that you can use this exe in your own applications (including commercial ones) provided you mention it in the documentation and provide a link. That means you are ok to use FileInstall(...) to include 7za.exe in the compiled .exe.

like image 94
Matt Avatar answered Dec 16 '25 23:12

Matt



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!