Batch modules

From wikinotes

Arguments

REM batch script arguments are listed numerically in order

REM path to batch script
echo %0

REM arguments, in order
echo %1
echo %2
...

number of arguments

set num_args=0
for %%x in (%*) do (
   set /a num_args+=1
)
echo %num_args%

iterate over arguments

REM 'shift' changes the %1 to %2, %3, ...
:Loop
IF "%1"=="" GOTO Continue
   ECHO %1
SHIFT
GOTO Loop
:Continue