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

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -