Moving file from subfolders into a mainfolder

Hello,

I am looking for a button which does the following thing:

move all files which are inside of subfolders to the mainfolder, afterwards delete all subfolders.
All filenames are different, so there will not be a problem regarding the movement.

  • mainfolder (all files should be moved here)
    -subfolder 1
    -subfolder 2
    etc

Could anyone give me the code for this action. Thanks a lot in advance !

1. One way to do it: Select the subfolders and try this code (you could also remove the delete command and delete the subfolders manually):

@dirsonly @nofilenamequoting Copy MOVE FILE "{filepath$}\*" HERE delete

2. Copying out of Flat View (Mixed, No Folders) mode into somewhere else is another way to do it. You'd need to delete the folders as a separate step.

Hi Christiaan,

well, the disadvantages of moving by copying is, that if you have a few thousend files in all the subfolders, it will take some time for the deleting process. Is there is way only to move the files without copying?

Your hint with the "Flat View" is great (completely forgot about this!), I guess I go for this. Deleting folders manually is not such a big deal. THANKS !!!

The code above does move the files without copying them ... :wink:

hm, if I use your script it will open a window telling this:

I am using Opus 9.1.3, German Version

First, I guess you should update to the latest DOpus version. It could solve some problems.

I tried the button, and it works fine for me.

Just a little tweak for it if you don't want to be bothered by the folder removal prompt, and the folders in the recycle bin:

@dirsonly
@nofilenamequoting
Copy MOVE FILE "{filepath$}\*" HERE
Delete QUIET NORECYCLE

[quote="dp_fan"]hm, if I use your script it will open a window telling this:

I am using Opus 9.1.3, German Version[/quote]

Have a look at this code too.

@Christiaan

I was fooled with the window by Opus. It DOES NOT copy the files. The window with the info just pops up - but that´s is a glicht in Opus I would say, since there are no more files in the folders.
Thanks agian !

@GoinPos
I updated Opus to 9.5 - but the window still shows up, but the files are not copied, though
Thanks for the code with the "Quiet" option - I will use this now.

@searcher123
Cool,I will take a look

Which window are you talking about? The progress window? Moving files still isn't instant so it's still legitimate to display a progress window while doing it. Just because progress is shown it doesn't mean the files are being copied rather than moved. Not sure if that's what you mean, though.