SHIFT [/n]


如果命令扩展名被启用,SHIFT 命令支持/n 命令行开关;该命令行开关告诉

命令从第 n 参数开始移位;n 介于零和八之间。例如:


    SHIFT /2


会将 %3 移位到 %2,将 %4 移位到 %3,等等;并且不影响 %0 %1




@echo off

rem MYCOPY.BAT copies any number of files

rem to a directory

rem The command uses the following syntax:

rem mycopy dir file1 file2 ...

set todir=%1



if "%1"=="" goto end

copy %1 %todir%

goto getfile


set todir=

echo All done

Changes the position of replaceable parameters in a batch file.


SHIFT [/n]


If Command Extensions are enabled the SHIFT command supports the /n switch which tells the command to start shifting at the nth argument, where n may be between zero and eight.  For example:


    SHIFT /2


would shift %3 to %2, %4 to %3, etc. and leave %0 and %1 unaffected.