Find files of multiple extensions batch

此生再无相见时 提交于 2019-12-12 09:43:25

问题


I'm trying to search for files of multiple under a specific directory. I know that if I wish to search for all .exe files under C:\Test, I do the following:

set FoundFiles=dir /b /s C:\Test\*.exe

But, what I wish to search for all .exe and .txt files under C:\Test? Is it possible in the same way? I tried the following:

dir /b /s C:\Test\*.exe *.txt

It works in cmd, however, when I do this:

set FoundFiles=dir /b /s C:\Test\*.exe *.txt

It doesn't work.

Is it even possible?


回答1:


This should work

dir /b /s *.exe /s *.txt


来源:https://stackoverflow.com/questions/16814470/find-files-of-multiple-extensions-batch

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!