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?

ysap
  • 2,730

1 Answers1

1

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?

ysap
  • 2,730