JustenDouma
JustenDouma

Reputation: 25

How to mention %10 and higher?

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 %10 %11 etc.
echo %*
exit /b

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

Upvotes: 0

Views: 105

Answers (1)

OJBakker
OJBakker

Reputation: 782

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

Upvotes: 2

Related Questions