Eu não consigo descobrir uma maneira realmente limpa de executar o segundo programa (ou arquivo em lote, ou qualquer outro) com a lista de argumentos modificados, mas acredito que tenha 88% do que você quer:
@echo offsetlocal enabledelayedexpansionset i=0for %%A in (%*) do (set /a i+=1echo arg !i! is %%Aset var!i!=%%A// This setsvar1=%1,var2=%2, …// and, of course, you could modify the values at this point.)// And at this point,%i%is the number of arguments.
(Other stuff)
︙for /L %%J in (1, 1, %i%) do (call :kludge var%%J//var%%Jis “var1” or “var2” or …echo arg %%J is !this_value!// This iterates through the original args,// and, of course, you could modify them here, too.)
(Other stuff)
︙exit /b
:kludgeset this_value=!%1!exit /b