How to make SHIFT work with %* in batch files

后端 未结 7 1860
独厮守ぢ
独厮守ぢ 2020-12-24 11:38

In my batch file on Windows XP, I want to use %* to expand to all parameters except the first.
Test file (foo.bat):



        
7条回答
  •  情书的邮戳
    2020-12-24 12:09

    Don't think there's a simple way to do so. You could try playing with the following workaround instead:

    @ECHO OFF
    >tmp ECHO(%*
    SET /P t=

    Example:

    test.bat 1 2 3=4
    

    Output:

    2 3=4
    

提交回复
热议问题