How to iterate through all arguments in batch script?

use shift command with goto, shift would copying each parameter into the previous one, %3 to %2, %4 to %3, etc. and leave %0 and %1 unaffected.


    @echo off
    setlocal
    set "here=%~dp0"

    :start
    rem "%here%pngquant.exe" --force --verbose 256 %1
    echo %1
    shift
    if not "%~1"=="" goto start

    pause