Extract only one type of file from zip file

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
shipaddicted
Posts: 95
Joined: 15 Jul 2016, 19:57

Extract only one type of file from zip file

02 Dec 2018, 13:40

I frequently download zip files that contain maybe 40 different folders inside, each containing several different file types of the same graphic. I only need to extract the .Svg files out - the rest is garbage to me (.Jpg, .Ai, .dxf, etc.), even the parent folders. How can I do this with AutoHotKey? ?

I have tried to figure this out via poking through the menus on the 7zip software, with no luck. If I just try to select via file type, it still extracts every single file, so I still have to go through the folders 1x1 and pull out what I need and delete the rest. I have read on the 7zip forums that this could be done with the command line, but nobody provides step-by-step instructions, just the formula for the end result and I haven't figured out how to read their formula so I can substitute what I need. And even if I did it this way, I would still likely want to do it via ahk. Can anyone help?

Thanks!
oif2003
Posts: 214
Joined: 17 Oct 2018, 11:43
Contact:

Re: Extract only one type of file from zip file

02 Dec 2018, 14:32

Does this work?
"C:\Program Files\7-Zip\7z.exe" e test3.7z *.exe -r

Where *.exe is the filter
and test3.7z is the 7z file
shipaddicted
Posts: 95
Joined: 15 Jul 2016, 19:57

Re: Extract only one type of file from zip file

02 Dec 2018, 15:16

I'm looking for .svg files - I'm not following how this would extract those. Would I substitute *.exe with *.svg ??

Thanks!
oif2003
Posts: 214
Joined: 17 Oct 2018, 11:43
Contact:

Re: Extract only one type of file from zip file

02 Dec 2018, 15:30

Yup! swap *.exe for *.svg
then try to execute this from AHK using "run"

You can also specify output folder using -o
ie: "C:\Program Files\7-Zip\7z.exe" e test3.7z -o outputdir *.exe -r

from: https://superuser.com/questions/321829/ ... ine#683817
shipaddicted
Posts: 95
Joined: 15 Jul 2016, 19:57

Re: Extract only one type of file from zip file

02 Dec 2018, 15:55

Run "C:\Program Files\7-Zip\7z.exe" e "C:\Users\Paige\Downloads\BF_2018-09-06.zip" -o "C:\Users\Paige\Desktop\Silhouettetemp\" *.svg -r

I have tried several variations of this with no luck (changing which paths are put into quotes ). If it's working, I don't know where they're being extracted to -- but I do know it's not to my silhouette temp folder on my desktop! ;)

I'm sure I've screwed up the syntax somewhere -- can you nudge me a little further in the right direction? Thanks!
oif2003
Posts: 214
Joined: 17 Oct 2018, 11:43
Contact:

Re: Extract only one type of file from zip file

02 Dec 2018, 16:13

What I told you earlier was not correct.... sorry about that.

I checked out the --help and came up with this that worked on my computer:
Run, "C:\Program Files\7-Zip\7z.exe" e -o"C:\Users\Name\Desktop\testfolder" "C:\Users\Name\Desktop\test3.7z" *.exe -r

Notice how -o follows e, and there is no space between -o and the directory path.
You can add -y to suppress overwrite prompt.
ie: Run, "C:\Program Files\7-Zip\7z.exe" e -y -o"C:\Users\Name\Desktop\testfolder" "C:\Users\Name\Desktop\test3.7z" *.exe -r

for more info: http://7zip.bugaco.com/7zip/MANUAL/swit ... ut_dir.htm
shipaddicted
Posts: 95
Joined: 15 Jul 2016, 19:57

Re: Extract only one type of file from zip file

03 Dec 2018, 22:58

I still haven't had any luck, but now I have a cold, so my brain is a mess. I can't concentrate when I'm all drugged up. I'll have to shelve this for a couple of days. BRB.
itssherylle1989
Posts: 1
Joined: 05 Dec 2018, 22:25

Re: Extract only one type of file from zip file

05 Dec 2018, 22:42

I used 7downloads to download zip app for my files it's really past. 7zip has a guide you can review here: https://7zipguides.com/.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot] and 329 guests