Recreate Empty Directory Structure

Non-Recursive Version

If you only want to re-create the top-level, selected directories and not the other directories inside them, use this command:

@dirsonly
@nofilenamequoting
CreateFolder NAME "{destpath$}{file$|noterm}"

That will take the folders selected in the source window/panel and create empty folders with the same names in the destination window/panel.

Recursive Version

If you want to re-create an entire hierarchy of empty directories you can do that as well.

The button below will copy just the selected folders and sub-folders -- but not any of the files -- from the source to the destination.

In other words, it will recreate the selected directory structure in the source by creating matching empty directories in the destination.

The screenshot below shows an example where the original structure on the left has been recreated on the right:

The button requires you to create a simple filter which matches the special [Folders Only] file type. You can do this via Settings -> Preferences as shown below:

Make sure you click OK or Apply in the Preferences window to finish creating the filter.

The button itself is very simple:

Copy FILTER="Folders Only"

Obviously, if you didn't call your filter Folders Only then you should change the name given to the Copy FILTER="xyz" command.

That's it. Now select the directories you wish to recreate and click the button to make it happen.

6 Likes

Great! This is very usefull!

Thanks!

avic

I've added the Non-Recursive Version to the top of the original post, for cases where you only want to reproduce the top-level of directories.

Thanks Leo ... from this information I created a new button. (Left click to copy just the upper level folder, Right click to copy all the folders recursively (without the files of course). Works great :slight_smile:

~Paul

Is there a way to include COPYCREATIONTIME=yes?

@dirsonly @nofilenamequoting CreateFolder NAME "{destpath$}{file$|noterm}"

It doesn´t work inserted after CreateFolder or at the end.

Why would you expect an argument from the Copy command to work with the CreateFolder command?

Hmm, that´s true. Maybe, because i used in in a similar way (copying folder structures) . The old command used a copy filter to
copy the folders structures. But i like the top-level only solution, so i´d like to have it combined with the
Copycreationtime feature, if possible.

You could do that by using the recursive version (i.e. the one with the Copy command), adding COPYCREATIONTIME=yes to the Copy command, and changing the filter it uses so that it doesn't go into any subdirectories (by adding a subfolder clause to the filter).

(You can't use the Copy command's arguments with the CreateFolder command, though. That'd never work. Commands only take the arguments they are documented as taking, not all the arguments from other commands.)

Ok, then i will modify my old command to only handle the top directories. Thanks.

Hi, I tried to use your recursive button to create a button that would only copy the files inside.

Basically I download podcasts into folders according to the name of the show, ie:

Z:\radio\All in the mind\whatevershow.mp3
Z:\radio\NPR Radio\anothershow.mp3
etc.

It is easy for me to copy these onto my mp3 player, then I want to archive only the podcast mp3 files into folders like:

Z:\radio\Already Put On MP3 Player\All in the mind\whatevershow.mp3
Z:\radio\Already Put On MP3 Player\NPR Radio\anothershow.mp3

, leaving the original folders intact (and empty) like:

Z:\radio\All in the mind\
Z:\radio\NPR Radio\

I tried making a filter called "Files Only", like from your first post (recursive one), using the Type:Match:[Files Only] filter, then making a button with command:

Copy FILTER="Files Only" MOVE

, but it still deletes the source folder, essentially doing just a move of the folder. I want it ideally to leave the source folders intact, just moving the files inside.

Any ideas??

Is it possible to make Recursive Version work with Duplicate option? Not working for me.
I.e. I'd like to duplicate the structure with the different name for the top folder.

Got it. Just Copy As Here ...
Ignore my question, please.

Hi
I'm sorry that asking a question here in this old tree.
I just found this solution when I was searching the forum.

So I have now created a button as is said in the instructions as well a filter for Recursive Version.
But it will not working for me when I try it out, I can see that the folders are copied over to the other lister, but when it's finished the folders disappears.

I have also tried the filter function in the copy menu, but it will not work there either.

Only difference I can see that I have three boxes in the filter that I can choose.

So what can I have done wrong here when the folders disappears?.

Thank you

Have a nice day
Sincerely
Thomas

I did a quick test and it's still working the same as it used to.

Check you've got everything exactly as in the top post and, if it's still not working, post screenshots of what you've done. Maybe we'll be able to see what's wrong from those.

Are you using the latest version of Opus as well? I tested with 12.22.1 (latest beta, but 12.22 should be the same).

Hi
Thank you for the reply.

I think I just found out what I did wrong in the configurations, I missed to changed the first column to type and I had name.
.
Although the last column says Folders and not [Folders Only] as on your picture, I hope that's ok?.

Any way it seems to work now thanks for your help and time.

Sincerely
Thomas

Hi! I've been using these custom buttons for just copying folders for a long time now and it's so useful, thank you for this!
I'm now in a situation where I need to copy ONLY the content from several selected folders into one target folder, but I'm having no success creating a button for this. Whatever I try it copies the folders with the files inside.
Anyone know how to set this up? Feels like it should be possible, right..? :slight_smile:

I can see a few ways to interpret that. To clarify things, please give some examples of what you want to do.

1 Like

Wonderful, thanks!
Let's say I have folder A and folder B open in a double lister. Folder A contains hundreds of folders with random files in the them and folder B is empty. I want to be able to manually select a few of the child folders in folder A and have only the files from within those folders copied to folder B. Does that make sense? Maybe there is not even a need for a custom button, I just haven't been able to figure out how to do it.

1 Like

This job description perfectly fits CopyFlat.

5 Likes

Thank you very much! That seems to be exactly what I need, will give it a try :slight_smile: