How to make SHIFT work with %* in batch files

后端 未结 7 1854
独厮守ぢ
独厮守ぢ 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:07

    Resume of all and fix all problems:

    set Args=%1
    :Parse
    shift
    set First=%1
    if not defined First goto :EndParse
      set Args=%Args% %First%
      goto :Parse
    :EndParse
    

    Unsupport spaces between arguments: 1 2 3 4 will be 1 2 3 4

提交回复
热议问题