将具有多种文件类型的 forfile 用于搜索掩码? [英] Using forfiles with multiple file types for search mask?
本文介绍了将具有多种文件类型的 forfile 用于搜索掩码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
以下命令适用于一种类型的文件,
Following command works fine with one type of files ,
forfiles -p "C:abc\del" -s -m *.exe -d -70 -c "cmd /c echo @path"
是否可以过滤多个文件扩展名?*.exe
、*.dll
、*.xyz
?
Is it possible filter through multiple file extensions? *.exe
, *.dll
, *.xyz
?
推荐答案
没有我希望的那么好,但这个 oneliner 可以提供帮助.但是请注意,您不能使用 * 作为过滤器,因为在这种情况下 IN 函数会开始选择文件.
Not as nice as I hoped for but this oneliner can help out. Notice however that you can't use * as a filter because the IN function starts selecting files in that case.
for %G in (.exe, .dll, .xyz) do forfiles -p "C:abc\del" -s -m *%G -d -70 -c "cmd /c echo @path"
使用this作为参考.
这篇关于将具有多种文件类型的 forfile 用于搜索掩码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文