setlocal enableDelayedExpansion SET BASEDIR="%~dp0" for /F %%x in ('dir /b /d /ad .') do ( cd %BASEDIR%\%%x install.bat )