How can I pass more than nine parameters to bach file.
I tried another SO question
How do you utilize more than 9 arguments when calling a label in a CMD batch-script?
My alternative allows you skip any number of arguments and requires no shifting
SETLOCAL
SET /a SKIP=3
CALL :SkipAndExec SKIP THESE VARS echo numbers: 1 2 3 4 5 6 7 8 9 0 11 12 13 14
ENDLOCAL
GOTO:eof
:SkipAndExec
SETLOCAL
SET /a n=0
FOR %arg IN (%*) DO (
SET /a n=n+1
IF %n% GT %SKIP% (
:: here you could compose a string to use later
SET _CMD_=%_CMD_% %arg%
)
)
:: here you could call another function and pass in %_CMD_%
CALL %_CMD_%
GOTO:eof
If you execute that script, it will print:
numbers: 1 2 3 4 5 6 7 8 9 0 11 12 13 14