What does %* mean in a batch file?

前端 未结 4 1220
南方客
南方客 2021-02-02 08:14

I have seen the usage of %* in batch files and command lines.

Can someone explain the typical usage of %* with an example?

4条回答
  •  北荒
    北荒 (楼主)
    2021-02-02 09:01

    One important point not listed in any of the previous answers: %* expands to all parameters from the command line, even after a SHIFT operation.

    Normally a SHIFT will move parameter %2 to %1, %3 to %2, etc., and %1 is no longer available. But %* ignores any SHIFT, so the complete parameter list is always available. This can be both a blessing and a curse.

提交回复
热议问题