topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Saturday April 20, 2024, 9:48 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Delete specific folders in a directory hierarchy tree  (Read 3030 times)

nkormanik

  • Participant
  • Joined in 2010
  • *
  • Posts: 553
    • View Profile
    • Donate to Member
Delete specific folders in a directory hierarchy tree
« on: November 23, 2021, 12:09 AM »
I've been searching for hours for an answer.  Such a simple thing.  Huge jumble of partial answers....

Given:  Large directory tree structure, folders with files, maybe some empty folders.

Challenge:  Move recursively throughout tree.  Delete all folders in entire tree that has in name "xyz".

There might be one such folder.  There might be one hundred.

Any thoughts greatly appreciated.

Nicholas Kormanik

(thanks @publicdomain, and others, for much help on many challenges)

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,169
    • View Profile
    • Donate to Member
Re: Delete specific folders in a directory hierarchy tree
« Reply #1 on: November 23, 2021, 05:41 AM »
Easy to do with Everything https://www.voidtools.com/
For example if the start folder of the tree is "C:\tree" then you can list all its subfolders with "xyz" in the subfolder name with this search line. (The option "match path" in the menu "Search" must also be enabled.)
"C:\tree\" xyz folder:
You can then select the subfolders in the results list and delete them, just like in File Explorer. Doing so will also delete any files within those subfolders, of course. If the subfolder name fragment you search for has spaces then quote enclose it e.g. "abc def".

3.png

This basic example can be modified for more complex searches, for example with regex pattern matching instead of a plain string.
« Last Edit: November 23, 2021, 05:53 AM by Nod5 »

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 736
  • Call me Vic!
    • View Profile
    • Donate to Member
Re: Delete specific folders in a directory hierarchy tree
« Reply #2 on: November 23, 2021, 10:42 PM »
Given:  Large directory tree structure, folders with files, maybe some empty folders.

Challenge:  Move recursively throughout tree.  Delete all folders in entire tree that has in name "xyz".

There might be one such folder.  There might be one hundred.

Hi Nick! nkTree coming:



Supports long paths via Win32 API library: 32000+ characters.

https://github.com/publicdomain/nktree

(I'm finally home & coding for the Public Domain :Thmbsup: November release -just some days to go)

(thanks @publicdomain Vic, and others, for much help on many challenges)

Having multiple community support is the best indeed!

(From my humble position, rest assured it's my pleasure, AMIGO :) )
My name's Victor but do feel free to call me Vic! (now known as "paradisusvic")

❤️ Support on Patreon @ www.patreon.com/paradisusis
New Email/Paypal: paradisusvicgmail.com
« Last Edit: November 23, 2021, 10:54 PM by publicdomain »

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 736
  • Call me Vic!
    • View Profile
    • Donate to Member
Re: Delete specific folders in a directory hierarchy tree
« Reply #3 on: November 30, 2021, 08:59 AM »
Hi Nick! nkTree coming

It's released: nkTree - GUI for actions on a directory tree (v0.1.0)

Enjoy!
:Thmbsup:
Vic
My name's Victor but do feel free to call me Vic! (now known as "paradisusvic")

❤️ Support on Patreon @ www.patreon.com/paradisusis
New Email/Paypal: paradisusvicgmail.com
« Last Edit: November 30, 2021, 09:08 AM by publicdomain »