windows下批量删除文件

FORFILES /P d:www /D -7 /S /M ex*.log /C "cmd /c del @path"

删除d:www目录下7天前ex*.log的所有文件

例子:

D: est>FORFILES /D -30 /S /M *jpg /C "cmd /c echo @path 0x09 在 30 前就被更改。

"D: estindex_ad1.jpg" 在 30 前就被更改。
"D: estindex_ad2.jpg" 在 30 前就被更改。
"D: estindex_ad3.jpg" 在 30 前就被更改。
"D: estindex_ad4.jpg" 在 30 前就被更改。
"D: estindex_ad5.jpg" 在 30 前就被更改。
"D: est淘宝商城多格jQuery焦点图index.jpg" 在 30 前就被更改。
"D: est淘宝商城多格jQuery焦点图imga01.jpg" 在 30 前就被更改。
"D: est淘宝商城多格jQuery焦点图imga02.jpg" 在 30 前就被更改。
"D: est淘宝商城多格jQuery焦点图imga03.jpg" 在 30 前就被更改。
"D: est淘宝商城多格jQuery焦点图imga04.jpg" 在 30 前就被更改。
"D: est淘宝商城多格jQuery焦点图img01.jpg" 在 30 前就被更改。
"D: est淘宝商城多格jQuery焦点图imgc01.jpg" 在 30 前就被更改。
"D: est淘宝商城多格jQuery焦点图imgc02.jpg" 在 30 前就被更改。
"D: est淘宝商城多格jQuery焦点图imgc03.jpg" 在 30 前就被更改。
"D: est淘宝商城多格jQuery焦点图imgc04.jpg" 在 30 前就被更改。
"D: est淘宝商城多格jQuery焦点图imgd01.jpg" 在 30 前就被更改。
"D: est淘宝商城多格jQuery焦点图imgd02.jpg" 在 30 前就被更改。
"D: est淘宝商城多格jQuery焦点图imgd03.jpg" 在 30 前就被更改。
"D: est淘宝商城多格jQuery焦点图imgd04.jpg" 在 30 前就被更改。
"D: est淘宝商城多格jQuery焦点图imge01.jpg" 在 30 前就被更改。

原文地址:https://www.cnblogs.com/rwxwsblog/p/4505855.html