Script that will find/display all .zip files in a directory?

Discuss and share scripts and script files...
Post Reply
Megalith
Posts: 78
Joined: 24 Jan 2015 16:53

Script that will find/display all .zip files in a directory?

Post by Megalith »

I'm not really sure where to start with this and could use some help. Basically, I need a quick way to find all .zip files within a directory so I can extract everything at once. I have tried using branch view and then filtering out the .zip files, but that takes a while.

I used to be able to do this easily with a program named ExtractNow; there was a context menu option that would search for all .zip files within a directory. Unfortunately, I had to stop using it since they started bundling malware/adware with it.

highend
Posts: 13317
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Script that will find/display all .zip files in a direct

Post by highend »

Something like this?

Code: Select all

paperfolder("ZipFiles", quicksearch("*.zip"));
Displays all .zip files in the current directory (recursive) in a paperfolder...
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 60567
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Script that will find/display all .zip files in a direct

Post by admin »

Wowee, cool script! :tup:

highend
Posts: 13317
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Script that will find/display all .zip files in a direct

Post by highend »

Best one I've ever written!
One of my scripts helped you out? Please donate via Paypal

Megalith
Posts: 78
Joined: 24 Jan 2015 16:53

Re: Script that will find/display all .zip files in a direct

Post by Megalith »

That definitely gives you all .zip files in a directory—but it won't let me select everything and unzip everything at once. Is that kind of thing even possible?

highend
Posts: 13317
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Script that will find/display all .zip files in a direct

Post by highend »

If you want to manually select files from that paperfolder list and extract them, execute this afterwards:

Code: Select all

    foreach($zip, <get "SelectedItemsPathNames" |>) {
        zip_extract($zip, gpc($zip, "path") . "\" . gpc($zip, "base"));
    }
Or if you really want to extract all found files you could do this without showing a paperfolder by:

Code: Select all

    foreach($zip, quicksearch("*.zip", , "|")) {
        zip_extract($zip, gpc($zip, "path") . "\" . gpc($zip, "base"));
    }
One of my scripts helped you out? Please donate via Paypal

Post Reply