如何在Windows中使用批处理文件删除包含某些字符串的文件? [英] How to delete files containing certain string using batch file in Windows?

查看:919
本文介绍了如何在Windows中使用批处理文件删除包含某些字符串的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的松下相机使用其愚蠢的PHOTOfunSTUDIO导入照片.它按拍摄照片的日期名称创建文件夹,并将照片分别导入到这些文件夹中.到目前为止,一切都很好.但是,如果在从相机中删除所有旧照片之前再次导入,则将通过添加名称后缀(002),(003),...再次导入旧照片,无论如何我都不会更改该软件的设置.

我的问题:如何从这些文件夹中删除所有带有名称后缀的文件?

例如,这是一个文件夹:

D:\Photos\2011\2011-12-01>dir  /b
20111201_184550(002).cont
20111201_184550(002).iis
20111201_184550(002).m2ts
20111201_184550(002).tmb
20111201_184550.cont
20111201_184550.iis
20111201_184550.m2ts
20111201_184550.tmb

解决方案

好的,也许我很愚蠢.它不需要任何批次:

del /s *(00?).*

My Panasonic camera uses its stupid PHOTOfunSTUDIO to import photos. It creates folders by the name of the date when photos are taken, and imports photos into those folders respectively. So far so good. But If I import again before removing all old pictures from camera, the old ones will be imported again by adding a name suffix (002),(003),..., no mater how I change the settings of that software.

My question: how to remove all the files that having name suffixes from those folders?

For example, this is one folder:

D:\Photos\2011\2011-12-01>dir  /b
20111201_184550(002).cont
20111201_184550(002).iis
20111201_184550(002).m2ts
20111201_184550(002).tmb
20111201_184550.cont
20111201_184550.iis
20111201_184550.m2ts
20111201_184550.tmb

解决方案

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

del /s *(00?).*

这篇关于如何在Windows中使用批处理文件删除包含某些字符串的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆