CODE: [Copy to clipboard]@echo off for /D /R C:\temp %%a in (*) do ( if exist "%%a\*.exe" if exist "%%a\*.txt" echo %%a )