Using Batch file SHIFT command

batch-file, cmd

Solution

Shift doesn't change the actual order, just the index/pointer into the arguments.

Try this:

@echo off
echo %1
shift 
echo %1
shift
echo %1
echo %*

And you get this:

a
b
c
a b c d

Problem

I'm trying to display up to 9 parameters across the screen, and then display one fewer on each following line, until there are none left. I tried this: ``` @echo off echo %* shift echo %* shift echo %* ``` Actual Result: ``` a b c d e f a b c d e f ``` Expected Result: ``` A B C D E F B C D E F C D E F D E F E F F ``` Any help? Thanks.

Original source

Related problems