Monday, June 17, 2019

windows 7 - How to delete files with specified text in their names?


I have a folder on my computer in which I have a lot of .jpg files.
I want to filter out all files that have a specific part in their name, for example:


We have a folder which contains files A.jpg, B.jpg, C_bad.jpg, D_bad.jpg, etc.


I want to delete every file that has "_bad" in its name.
Is something like this even possible? Or do I have to delete all these files manually?


Answer



I want to filter out all files that have a specific part in their name


You can do this with wildcards.




From a command line


To display matching files:


dir *_bad.jpg

To delete matching files:


del *_bad.jpg

Use the /s option to match files in subdirectories as well as the current directory.




From Explorer


To display matching files:



  • enter *_bad.jpg in the search box


To delete matching files:



  • enter *_bad.jpg in the search box, select the results and press Delete or Del




Further reading


wildcards


No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...