@echo off for /f %%i in ('dir python*.msi /B') do (call :SUB1 %%i) GOTO :EOF :SUB1 %1