@echo off for /f "delims=" %%f in ('dir /b ^|findstr -i window*') do ( echo name: %%f )
注意:与cmd窗口执行不同,bat中必须有个^
cmd加不加^都支持,效果如下: