How to increment for loop variable in batch script?
<pre><code>::Compare with available valid arguments
FOR /L %%i IN (1,1,!avArgc!) DO (
    FOR /L %%j IN (1,1,!argc!) DO (
        IF !avArgv[%%i]!==!argv[%%j]! (
            echo Match: !avArgv[%%i]!

            ::Check the next option
            SET /A nextArg=%%j
            SET /A nextArg+=1
            FOR /L %%n IN (!nextArg!,1,!nextArg!) DO ( 
                IF !nextArg! LEQ !argc! ( 
                    echo next arg: !argv[%%n]!
                    call :CheckSubOption
                )
            ) 
        )
    )
)
</code></pre>

<p>In my above code example - How do I take for loop variable like <code>%%j</code> and increment itself within the for loop like this <code>%%j++</code> ? Current solution that I have (which is messy and I don't like it) is to create a new variable and set it to the value of <code>%%j</code> and then increment that variable and start using that variable like this:</p>

<pre><code>::Check the next option
SET /A nextArg=%%j
SET /A nextArg+=1
</code></pre>