Search for files of several extensions

I am trying to search for files from several under a specific directory. I know that if I want to search all .exe files in C:\Test , I do the following:

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

But, what do I want to find for all .exe and .txt files in the C:\Test section? Is it also possible? 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 

This does not work.

Is it possible?

+4
source share
1 answer

This should work

 dir /b /s *.exe /s *.txt 
+8
source

Source: https://habr.com/ru/post/1483361/


All Articles