PDT 3200 Technical Reference Guide
Command
Type
Purpose
SHIFT moves each replaceable parameter for a batch Þle one position Òto the left.Ó
Execution of the SHIFT command allows use of more replaceable parameters in a
batch Þle--beyond the standard set of %0 through %9.
Syntax
SHIFT
Remarks
This command moves the string or value stored for each replaceable parameter
one position to the left. Upon execution of SHIFT, the %0 argument assumes the
value of the %1 argument, the %1 argument then assumes the value of the %2
argument, and so on.
Examples
The following example batch Þle will read in a list of Þles (provided as arguments
on the command line), and display each one to the screen. After displaying each
one, the SHIFT command copies the next Þle in the argument list into the %1 slot,
veriÞes the existence of the Þle and continues.
Command line argument:
TYPEIT autoexec.bat config.sys net.bat
TYPEIT.BAT batch file:
:repeat
if EXIST %1 goto doit
goto end
:doit
type %1
pause
shift
goto repeat
:end
@echo All Done
5-84
SHIFT
Internal Batch Subcommand