WORKINGDIR "c:\download\destination\folder" FTPLOGON "RemoteSite" IFERROR RETURN SET new_extension = %date + ".txt" ;; only process files matching this pattern: *.txt :start_of_loop FTPGETFILE "*.txt" IFERROR RETURN $ERROR_SUCCESS SETREPLACE FileName = %sitefile ".txt" new_extension ;; recombine but insert date RCVFILE %sitefile /as FileName IFERROR RETURN GOTO start_of_loop