Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find files of multiple extensions batch

Tags:

batch-file

dir

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?

like image 827
Idanis Avatar asked Feb 17 '23 09:02

Idanis


1 Answers

This should work

dir /b /s *.exe /s *.txt
like image 183
Marius Avatar answered Mar 20 '23 22:03

Marius