草庐IT

AllowExt

全部标签

Windows 批处理脚本 - 如何过滤具有定义扩展名的文件

我想用在变量中定义的扩展名对图像做一些事情。以下脚本运行良好:setAllowExt="jpgpngbmp"forfiles/pD:\Pictures/m*.*/c"cmd/cifnot%AllowExt:jpg=%==%AllowExt%echo@file但是下面的脚本会报错setAllowExt="jpgpngbmp"forfiles/pD:\Pictures/m*.*/c"cmd/cifnot%AllowExt:@ext=%==%AllowExt%echo@file"错误:无效参数/选项-'png'。输入“FORFILES/?”供使用。 最佳答案