Command Prompt for Windows

Command SHIFT


Change the position of replaceable parameters in a batch file.


SHIFT [/num]
/numStart shifting parameters from parameter num.


The SHIFT command changes the values of replaceable parameters %0 through to %9, by copying each parameter into the previous one.

When switch /num is specified, for example /3 is specified, then parameters %0, %1 and %2 are not shifted and parameter %4 is shifted to parameter %3, parameter %5 is shifted to parameter %4 and so on.

When there are more then 10 command line parameters, each will be shifted one at a time into parameter %9.

Also see Batch Files.