Windows – dir command – search for file names with partial string and file extension

cmd.execommand linewindows

I have a hard drive containing really unorganized folders of movie files. Now I want to use the dir cmd command to search for the following:
– a filename, containing both the strings 'holiday' and '2017', in no particular order, and the file extension must match any of the following: .mov .mp4 .avi

Note that the strings 'holiday' and '2017' are not necessarily next to each other, there can be other words in between.

How to achieve this? I played around with dir /s combined with findstr but no success

Best Answer

How to achieve this? I played around with dir /s combined with findstr but no success

You need to use findstr twice, together with dir /b /s, something like the following (not tested):

dir /b /s *.mov *.mp4 *.avi | findstr /i "holiday" | findstr "2017"

Further Reading

Related Question