What does %* mean in a batch file?

前端 未结 4 1224
南方客
南方客 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:14

    It means "all the parameters in the command line".

    For example, it's useful when you want to forward the command line from your batch file to another program:

    REM mybatchfile.cmd
    echo You called this with arguments: %*
    echo I will now forward these to the DIR command.
    dir %*
    

提交回复
热议问题