How to get the rest of arguments in windows batch file? -
i know can first argument %0, second %1, , on.. , can arguments %*.
can arguments second arguments? example, if run
foo.bat bar1 bar2 bar3 bar4 how can bar2 bar3 bar4?
@echo off setlocal set allargs=%* if not defined allargs echo no args provided&goto :eof set arg1=%1 call set someargs=%%allargs:*%1=%% echo allargs %allargs% echo arg1 %arg1% echo someargs %someargs% this leave someargs @ least 1 leading separator (if set)
Comments
Post a Comment