R.Wieser
2024-04-22 15:16:03 UTC
Hello all,
I've got a batchfile in which I use the first (%1) argument as a switch to
decide which program should be started with the remaining arguments.
The problem is that I can't seem to find how to pass the unknown number
of(!) remaining arguments to the called program.
I'm aware of "%*", which stands for "all arguments but %0", but when I use
SHIFT (to get rid of "%1" it doesn't change.
iow:
echo %*
shift
echo %*
shows the same on both lines.
Question:
How do I provide all arguments starting from the second one to the program ?
Currently I just use "program.exe %2 %3 %4 %5 %6 %7 %8 %9" and be done with
it, but would like to know a way to provide more than 9 arguments to the
batchfile and still have it work.
Regards,
Rudy Wieser
I've got a batchfile in which I use the first (%1) argument as a switch to
decide which program should be started with the remaining arguments.
The problem is that I can't seem to find how to pass the unknown number
of(!) remaining arguments to the called program.
I'm aware of "%*", which stands for "all arguments but %0", but when I use
SHIFT (to get rid of "%1" it doesn't change.
iow:
echo %*
shift
echo %*
shows the same on both lines.
Question:
How do I provide all arguments starting from the second one to the program ?
Currently I just use "program.exe %2 %3 %4 %5 %6 %7 %8 %9" and be done with
it, but would like to know a way to provide more than 9 arguments to the
batchfile and still have it work.
Regards,
Rudy Wieser