@ECHO OFF

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

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

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

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

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

:ELSE
    ECHO CHANGED: No drives were specified.

:ENDIF

