2

When using the SHIFT command to shift the script parameters one position down, I can see the values shift by echo-ing the %1 parameter:

:: scr1.bat
echo %*
echo %1
shift
echo %1

Then:

> scr1.bat aa bb cc
aa bb cc
aa
bb

However, if I echo the parameters list after the shift, it does not seem to change:

:: scr2.bat
echo %*
shift
echo %*

Then:

> scr2.bat aa bb cc
aa bb cc
aa bb cc

Why doesn't SHIFT work on the full parameters list?

1

1 Answer 1

2

OK, found in the MS document, in the remarks section:

  • Using %* with shift

Shift has no affect on the %* batch parameter.

Now one is just left to wonder why?

1
  • 1
    A bug? Another Microsoft idiosyncrasy? Commented Jan 29 at 21:40

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.