@echo off cd /d "%~dp0" for %%F in ("%~dp0*.exe") do ( "%%~fF" if errorlevel 1 pause exit /b %ERRORLEVEL% ) echo exe not found pause