eg you have a batch command process.bat which expects 1 file parameter and the target directory is c:\dir
for /F "tokens=1 delims= " %i in ('dir /B c:\dir') do @process.bat %i
to cater to files with spaces in them
for /F "delims==" %i in ('dir /B c:\dir') do @process.bat %i