I know how to delete a single sub folder or multiple ones by mask:
rmdir /s /q C:\Somedir\DirToDelete
or
rmdir /s /q C:\Somedir\DirsToDelete*
But I want to delete all sub folders, say, with name DeleteMe, from all sub folders within C:\Somedir.
Ideas?
Another way is (only PowerShell)
Remove all DeleteMe dirs recursive in last "asterisk" path.
-WhatIf = only show which dirs will remove, no do it - nice for check before destroy other data:)
UPDATE 1 After some labor... this update is better... line before can delete only empty folders. This can delete folder with content:
First you want to list all the directories you want to remove. Then use that to delete them all. Here's a quick and dirty example using what you put in there.
Please test this out before you kick it off for your environment. I usually would replace the rmdir with echo to make sure it works.