I have a batch-script with multiple arguments. I am reading the total count of them and then run a for loop like this:
@echo off
setlocal enabledelayedexpans
For simple iteration can't we just check for additional arguments with "shift /1" at the end of the code and loop back? This will handle more than 10 arguments, upper limit not tested.
:loop
:: Your code using %1
echo %1
:: Check for further batch arguments.
shift /1
IF [%1]==[] (
goto end
) ELSE (
goto loop
)
:end
pause