@ECHO OFF

:
:    BACKALL.CMD -- Generates a parameter file to 
:	back up all files the drives specified, for example:
:
:		"BACKALL C D E"
:	
:	Will back up all files on drives C, D, and E.  
:

:-----Check for command line arguments
IF "%1"=="" GOTO ELSE

    :-----Delete previous parameter file
    IF EXIST .\$$tmp.tpf DEL .\$$tmp.tpf 
    ECHO !BACKUP >.\$$tmp.tpf

    :-----Add line to parameter file for each listed drive
    :BEGINWHILE
        IF "%1"=="" GOTO ENDWHILE
        ECHO /x IMAGE-%1 /n IMAGE-%1 /g /r /q /s %1:\*.* >>.\$$tmp.tpf
        SHIFT
        GOTO BEGINWHILE
    :ENDWHILE

    :-----Start backup
    EZTAPE .\$$tmp.tpf
    DEL .\$$tmp.tpf
    GOTO ENDIF

:ELSE
    ECHO BACKALL: No drives were specified.

:ENDIF

