Extract RAR files and moving the rars, can't make button

Hoping someone might be able to code this, or help me! It's just so hard. I keep trying but I don't think I'll really get it.

I am extracting RARs that have been split into multiple parts.

eg.
MUSIC.part1.rar
MUSIC.part2.rar
MUSIC.part3.rar

What I want to do is, after manually selecting the first (or any rar) in the set, have a button that will:

[b]1. Extract to a new folder named after the rar set: "Music".

  1. Move all the rars from that set (Music.partX.rar 's) to a folder named after the rar set and with "RARS" appended to the end: "Music -rars"
    [/b]
  • I'd like to be able to do it by working on all rars in folder or all the selected ones. (maybe more complicated).

Like I've made a lot of test buttons now, but I can't get it. But I get kinda close now and then, in a not really kinda way.

I've sort of managed to automatically select a set of rars (from matching the selected one), but only when I stripped the .rar from the end. Then move them to a folder named after the first one with "rars" on the end.

I have tried so many different little variations, and none are getting any closer, so I think I might be going at it the wrong way.

Can anyone here help me with this, please?
Can this be done?

I've only really been testing on split archives. I've just tested this one on a single archive, and it works how I want. It'll extract to a new folder and move the selected rar to a new folder also.

<?xml version="1.0"?> <button backcol="none" display="both" textcol="none"> <label>Extract Test</label> <icon1>#newcommand</icon1> <function type="normal"> <instruction>@NODESELECT</instruction> <instruction>Copy EXTRACT here CreateFolder=&quot;{file$|noext}&quot; </instruction> <instruction /> <instruction>@nofilenamequoting</instruction> <instruction>@runonce:@set dirname={file$|noext}</instruction> <instruction>Copy MOVE HERE FILE=&quot;{file$}&quot; CREATEFOLDER=&quot;{$dirname} rars&quot;</instruction> </function> </button>

So this is how I do want it to work on single archives... But for ones that are split, I still need to get it to pick the parttern in a name and indentify rars that are part of set by the same name with just a different part no.

I wonder it's possible to to tell the difference and work correctly for whatever type?