passing on unused parameters
Posted: 19 Oct 2007 11:36
I have a batch file (lets call it doit.bat) which calls doit.exe. doit.bat wants to sonsume the first 3 arguments, and pass any remaining ones to doit.exe. On unix I am used to shifting away the used arguments and hten passing on $*. However in dos %* seems unaffected by shift? is this really the case or am I missing somehting
doit.bat
set arg1=%1
shift
set arg2=%2
shift
.. do some stuff
doit.exe %3 %4 %5 ( there may be none or 20)
seems a bit silly to just specify %3 %4 %4 ... %20 .. %999
doit.bat
set arg1=%1
shift
set arg2=%2
shift
.. do some stuff
doit.exe %3 %4 %5 ( there may be none or 20)
seems a bit silly to just specify %3 %4 %4 ... %20 .. %999