How do I recursively delete all files or folders whose names match a pattern in Windows?

Posted by zylstra on Super User See other posts from Super User or by zylstra
Published on 2012-04-06T21:15:39Z Indexed on 2012/04/06 23:34 UTC
Read the original article Hit count: 142

Filed under:
|
|
|
|

For the file example, I would like to delete all files matching .+?[a-f0-9]{4}.html (i.e. any html file ending in a four digit hexadecimal). So paged47c.html would be deleted, but page.html would remain.

For the folder example, I would like to delete all folders matching .+?[A-Z]+ (i.e. any folder containing a capital letter). So some-folderSE93_89ds/ would be deleted, but some-folder/ would remain.

I don't work much with the command line, but I could probably get an example involving "del" to work for me. Alternatively, is there a simple GUI program for Windows that would do this?

© Super User or respective owner

Related posts about windows-7

Related posts about file