Does %* in batch file mean all command line arguments?
59,161
Yes. According to the official Microsoft documentation:
The %* batch parameter is a wildcard reference to all the arguments, not including %0, that are passed to the batch file.
Related videos on Youtube
Comments
-
Matt over 1 year
Does
%*
in batch file mean all command line arguments? -
ajf0 over 9 years@kokbira or you can use shift to access the rest
-
Kevin Fegan about 4 years@TWiStErRob - I'm sure you know it but to be clear... even with %* you need to use shift to access parameters beyond %9. The advantage of using %* is you can pass the entire ORIGINAL parameter list (including parameters that have been "shifted out") to an external batch or other program, or with a
call :label %*
, even if you don't know how many parameters are in the list (or if it's more than 9). -
mirabilos over 2 yearsIs this quoted properly, like
"$@"
in sh?