GP SoftwareTwitter
Opus FAQsManualCommandsObjects

Delete contents of sub folders from main folder

I've got a main folder and it has lots of sub folders.

Is it possible to delete the contents of the sub folder from the main folder?

Yes.

This command is one way of doing it:

Delete {filepath$}\*

I'm really new to DOpus and I was able to figure out how to create a Command line thing but it doesn't work so, I guess I did something wrong.

I've attached a snapshot of what I did.

Any help would be appreciated.


Creating a User Command is the wrong thing to do. Instead, create a new button directly on your toolbar or menu (or a new standalone hotkey if that's what you want).

Check out the Toolbar Editing video tutorial to quickly learn how to do it.

I watched the video and was able lto to create a new button.

I added Delete {filepath$}* but it didn't work.

I guess I'm still doing something wrong.

Suggestions welcomed.

That looks right. What are you expecting it to do?

If you select some folders (in the file display, not the folder tree) and then click that button, it will delete everything below those folders.

I didn't realize I needed to select the folders where I wanted to have the files deleted....I just selected the main folder.

Thanks for all your help.

I tried it out on one of the sub folders and it worked great.

Then, I tired it on a folder higher up (0FS0\1_Daily_Masters2) and selected all the folders BUT when it was done all my folder were deleted (I guess I wasn't paying attention).

What I want to do is go to the top folder 0FS0 select the 0FS0-1_Daily_Masters2 folder and delete all the files below that point but not delete any of the folders.

Suggestions?

To do that, first create a Filter which only matches files:

[ul][li]Settings -> Preferences -> File Operations -> Filters

[/li]
[li]Click the New filter icon:


[/li]
[li]Name the new filter FilesOnly

[/li]
[li]Click the + button, where it says "Click here to add a filter clause.":




[/li]
[li]Set the clause to: Type Match [Files Only]:




[/li]
[li]Click OK to close the Preferences window.[/li][/ul]

Now make a button which runs this command:

Delete FILTER="FilesOnly"

If I understand you correctly, I wanted to do that for years and I found a simpler way to go forward without any buttons:

  • Select the top folder in the tree that you want to empty of all files (but keeping all the folders).
  • Go to View -> Flat View -> Mixed (no folders). This (obviously) displays all the files in all the subfolders, but not the subfolders themselves.
  • Select all the files and delete.
  • Give all praise and thanks to the power of the mighty DOPUS!

Personally I find flatview so incredibly useful, I made a button just for flatview....

Another way is to use the Find command to get a list of what you want, then delete everything in the list.

The nice thing about the filtered delete button (from my previous reply) is that once it is setup it's a one-click solution, and by far the quickest method if you only want to delete the files below some of the subdirs, not all.

On the other hand, if it's not something you're going to do often, using Flat View or Find makes sense as the amount of effort with those methods is lower for a one-off task.

Greetings,
I want to delete any files and dirs under a selected dirs, except those ones that have a + at the beginning. I defined a filter named "NoPlusDelete" as follow:


Then I defined a key with the following code:

Delete FILTER="NoPlusDelete" {filepath$}\*  

Now just the files without + at the beginnings are deleted and dirs (with or without a + at the beginning) are not deleted at all! What is the problem, please?

Best Regards