How to avoid double folder creation on extracting archives?

I often use the command "Copy EXTRACT=sub HERE" to extract an archive to a folder called as the archive name.

Is it possible to prevent the creation of the subfolder if such a folder (having the same name) is already in the archive!?

In other words I want to avoid to end up with two nested folders when extracting Foobar.rar if the root folder in the archive itself is already called Foobar.

This is the default behaviour of WinRAR when extracting archives to a folder and I really like it.

Not currently, except by extracting directly to the current folder (which won't be what you want if the archive doesn't have everything in a subfolder).

Wow!! I came to the forum for the very same reason. The double folder creation in the long run renders the "sub=HERE" button meaningless because a user still has to take time to delete the sub folder or get stuck with double. Now imagine how frustrating this become when you deal with lots of archives on a weekly basis.

Well, until a fix comes along for this on DOpus, you can be saved with a small free program called ExtractNow. It extracts and deletes the sub folders and even move files, rename, auto insert passwords for protected archives in one shot, if you ask it to.
I've dreamed of having these automated sets of task in Opus so I wouldn't have to keep switching between two progs but I won't hold my breath.
Now, if somebody with script knowledge here could get Opus and ExtractNow to work together like how a user made Opus and Everything works, that would be super awesome :slight_smile:

You don't have to use EXTRACT=sub HERE if you don't want to. You can use HERE on its own if you know the archive has everything in a subfolder.

Or you can make a button or hotkey which moves everything up one level in one push, so that you can use sub=HERE and then quickly adjust the results when and if needed, if you like.

We might add the option to only create a sub-folder if there is more than one item in the archive in the future.

this would be an awesome feature for sure! :slight_smile:

at the moment, i use some code posted elsewhere on this forum to move all the folders and delete the empty folder. however, this can get a bit cumbersome when lots of archives have been extracted wrong in one go.
@confirm Move all files + folders in current dir up a level and delete current dir?
@set ChildPath={sourcepath$|noterm}
@runmode hide
Copy MOVE * TO ..
Go ..
rmdir {$ChildPath}

Was this ever implemented?

I don't think it was implemented, but it could be done using scripting these days.