oem.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
SHIFT--Example
Syntax  Notes
────────────────────────────────────────────────────────────────────────────
 
                               SHIFT──Example
 
The following batch file, MYCOPY.BAT, shows how to use the SHIFT command
with any number of parameters. It copies a list of files to a specific
directory. The parameters are the directory name followed by any number of
filenames.
 
    @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
    :getfile
    shift
    if "%1"=="" goto end
    copy %1 %todir%
    goto getfile
    :end
    set todir=
    echo All done
 
                                      ♦