- shift has not influence on %*
- getting rid of quotes in arguments can be done in an easier way than I used to – or can it?
But no – does not work :(
Used to get rid of quotes with
Found in the help, that it can be done with
And I was happy to find an easier way but only for a short while. If there are embedded quotes it does not work, so my old method is still the best :)
If you are not aware of the other stuff %~ can do, consult Help and Support Center on your PC. A useful feature is this:
Copy "%BatFileDirectory%\somefile.exe" somewhere
Back to the %*. How can it be done? Try this – other clever ways are welcome –
if defined onevalue (
if defined rest (
set rest=%rest% %~3
) else (
A warning: If the input contains parenthesis, you have to make a goto-based implementation instead of the multi-line if.