does %* in batch file mean all command line arguments?

up vote 36 down vote accepted

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.

  • 5
    note: if you have 30 words separated with spaces as argument, you can only take the 9 first words with %i, with i from 1 to 9, but with %* you can take all the 30 words – kokbira Apr 25 '11 at 20:38
  • 4
    @kokbira or you can use shift to access the rest – TWiStErRob Nov 10 '14 at 13:38

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.