How to delete files containing certain string using batch file in Windows?

≯℡__Kan透↙ 提交于 2019-12-05 03:13:14

OK, maybe I was stupid. It does not need any batch:

del /s *(00?).*
spearson
del *"("*")".* /s 

The " " around the ( mean that it is a character instead of being part of the delete command.
/s - includes all subfolders

http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/del.mspx?mfr=true

http://msdn.microsoft.com/en-us/library/ms690414%28v=vs.85%29.aspx

you can easily use wildcard asterix (*) to search like any search utility

-- search current folder when directory is not specified

del Search_Service_Application_1_*.trn

-- specifying specific folder working even if you are in another drive

del d:\test\*copy*.txt
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!