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