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

**URL:** https://resource.dopus.com/t/extract-rar-files-and-moving-the-rars-cant-make-button/9926
**Category:** Help & Support
**Created:** [September 13, 2010, 7:41am UTC](https://resource.dopus.com/t/extract-rar-files-and-moving-the-rars-cant-make-button/9926 "2010-09-13T07:41:32Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![brassdfoo](https://resource.dopus.com/letter_avatar_proxy/v4/letter/b/aca169/32.png) [@brassdfoo](https://resource.dopus.com/u/brassdfoo)
#### Post date: [September 13, 2010, 7:41am UTC](https://resource.dopus.com/t/extract-rar-files-and-moving-the-rars-cant-make-button/9926/1 "2010-09-13T07:41:32Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![brassdfoo](https://resource.dopus.com/letter_avatar_proxy/v4/letter/b/aca169/32.png) [@brassdfoo](https://resource.dopus.com/u/brassdfoo)
#### Post date: [September 13, 2010, 1:19pm UTC](https://resource.dopus.com/t/extract-rar-files-and-moving-the-rars-cant-make-button/9926/2 "2010-09-13T13:19:06Z")

</div>

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?
