Delete Filter (for folders)

Is there a way to delete folders that are non empty with the delete filter command? I would like to delete subfolders of a target folder. I saw in a previous post that this wasn't possible, but wanted to ask again to see if there were workarounds.

Thanks

I'm not sure it can be done using delete filters, but it can definitely be done in other ways (e.g. scripting, or using Find Files and then deleting from the results).

What do you want to do in more detail? Is it a one-off or infrequent task, or something you'll be repeating a lot?

Hello,

It will be something I will be repeating a lot. I want to categorize files such as

  • Top Folder
    • Folder A
      • Subfolder A
        • Files
    • Folder B
      • Subfolder B
        • Files
    • Folder C
      • Subfolder C
        • Files

Etc. My goal is to keep the "Folders", while being able to delete the subfolders and files underneath. Those "Folders" would remain so when I continue placing files for editing there, I do not have to recreate the folder.

Any different approach based on my use case?

If you are in Top Folder and then Ctrl-A (Select All), so Folder A, Folder B, Folder C are selected, and then run this command:

Delete {filepath}\*

That will delete everything below those folders.

Is that what you want?

It will also delete files directly below Folder A that aren't in a nested sub-folder, which may not be what you want?

Hello,

Yes this works well, My Delete Filter function wouldn't work, which I think was explained in a prior post.

The files Folder A can be deleted in this instance, if there are any that are not nested.

Thanks for your help.

1 Like