S
survivor
I am writing a cmd script that needs to shift the input parameters.
When I do that, the %* value stays the same! Run the following test
script yourself and see the %* always contains the same string, even
after the SHIFT. Is there a work around for this bug? I'm sure
someone must have hit this problem before.
Thanks for any pointers.
================================================
testme.cmd:
@echo off
echo zero="%0", first="%1", second="%2", all="%*"
SHIFT
echo zero="%0", first="%1", second="%2", all="%*"
SHIFT
echo zero="%0", first="%1", second="%2", all="%*"
================================================
run it:
zero="one", first="two", second="three", all="one two three"
zero="two", first="three", second="", all="one two three"
When I do that, the %* value stays the same! Run the following test
script yourself and see the %* always contains the same string, even
after the SHIFT. Is there a work around for this bug? I'm sure
someone must have hit this problem before.
Thanks for any pointers.
================================================
testme.cmd:
@echo off
echo zero="%0", first="%1", second="%2", all="%*"
SHIFT
echo zero="%0", first="%1", second="%2", all="%*"
SHIFT
echo zero="%0", first="%1", second="%2", all="%*"
================================================
run it:
zero="testme", first="one", second="two", all="one two three"testme one two three
zero="one", first="two", second="three", all="one two three"
zero="two", first="three", second="", all="one two three"