Home > Mobile >  How to mention  and higher?
How to mention  and higher?

Time:09-25

I'm trying to make a batch file I call from another batch file, but the variables don't work after 9, and while I could just insert the code for the file I call, that is highly impractical and inelegant.

If I were to use %* it does read all variables but I need them to be separate, not as a group

here's the code to demonstrate the issue:

call temp.bat a b c d e f g h i j k l m n o p q r s t e u v w x y z
pause
exit

and the called file:

echo %1 %2 %3 %4 %5 %6 %7 %8 %9   etc.
echo %*
exit /b

I have already tried a trailing %, hexadecimal, and quoting it, none of them worked.

CodePudding user response:

Use the internal command SHIFT repeatedly to access the parameters beyond %9. See SHIFT /? for details on how to use this.

  • Related