topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Sunday August 14, 2022, 12:44 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Extract Archives Within Each Relevant Sub-Folder  (Read 408 times)

nkormanik

  • Participant
  • Joined in 2010
  • *
  • Posts: 509
    • View Profile
    • Donate to Member
Extract Archives Within Each Relevant Sub-Folder
« on: June 12, 2022, 08:54 PM »
Suppose the following:

Overall Parent Folder: Various

Sub-Folder 1:
1001.part1.rar
1002.part2.rar

Sub-Folder 2:
2001.part1.rar
2002.part2.rar
2003.part3.rar

...

Sub-Folder 99:
9901.part1.rar
9902.part2.rar

I would really, really like to find a way to automatically recursively travel throughout the overall initial parent folder, into each sub-folder, and extract each set of archives therein to that relevant sub-folder.

Any suggestions greatly appreciated.

Thanks!
Nicholas Kormanik


tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 11,897
    • View Profile
    • Donate to Member
Re: Extract Archives Within Each Relevant Sub-Folder
« Reply #1 on: June 13, 2022, 10:35 AM »
This one sound similar and could be modified if necessary:
I wrote a AHK script for myself once + integrated it in 2xplorer. So I just click a button and all archives in the folder get unpacked. Perhaps it's of use for you? It unpacks all archives in a folder in a subfolder (archive-name).

Installation: paste code in notepad, edit the second line pointing to winrar.exe, save as whatever.ahk, install authotkey (autohotkey.com)

Usage: Copy sourcefolder in clipboard and launch the script, or pass the sourcefolder as first parameter. An optional second parameter would be a targetfolder (where to place unpacked files).

It's pretty old though, I know AHK got a major update at some stage...
Tom

4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,574
    • View Profile
    • Donate to Member
Re: Extract Archives Within Each Relevant Sub-Folder
« Reply #2 on: June 14, 2022, 03:30 AM »
Any suggestions greatly appreciated.

Learn a scripting language.

Code: PowerShell [Select]
  1. Get-ChildItem .\test\* -include *.part1.rar -Recurse | % { .\7z.exe x $_ -o"$(Split-Path $_ -Parent)"}

nkormanik

  • Participant
  • Joined in 2010
  • *
  • Posts: 509
    • View Profile
    • Donate to Member
Re: Extract Archives Within Each Relevant Sub-Folder
« Reply #3 on: June 14, 2022, 08:35 PM »
@tomos and @4wd  Thanks!

On "scripting," any comments as to what you have found to work well in most of the cases you've encountered?

Autohotkey, Powershell, Python....  C#??


4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,574
    • View Profile
    • Donate to Member
Re: Extract Archives Within Each Relevant Sub-Folder
« Reply #4 on: June 15, 2022, 01:17 AM »
C# isn't a scripting language.

I'd go with anything that's cross-platform, eg. PowerShell, Python, etc.