clear cSource = 'd:\examples\plus10\' cBackup = 'd:\examples\plus10\Backup\' set safety off aSource = new array() adir(aSource,cSource+'*.*') aBackup = new array() adir(aBackup ,cBackup+'*.*') for n = 1 to aSource.size/5 cSname = trim(aSource[n,1]) if upper(substr(cSname,len(cSname),1)) <> 'O' ; and not upper(cSname) = 'BACKUP' ; and not '.MDX'$upper(cSname) ; and not '.DBF'$upper(cSname) ; and not '.DBT'$upper(cSname) cSdate = aSource[n,3] cStime = aSource[n,4] nRow = aBackup.scan(cSname) cFromFile = cSource+cSname cToFile = cBackup+cSname if nRow = 0 //Not in Backup copy file '&cFromFile' to '&cToFile' else cBname = aBackup[nRow] cBdate = aBackup[nRow+2] cBtime = aBackup[nRow+3] if cSdate < cBdate copy file '&cFrom' to '&cBackup' elseif cSdate = cBdate ; and cStime < cBtime copy file '&cFrom' to '&cBackup' endif endif endif next set safety on ? 'Done'