WORKINGDIR "c:\source\folder" :loop ;; populate %nextfile variable with file name matching wildcard pattern GETNEXTFILE "Weekly*.dat" IFERROR RETURN $ERROR_SUCCESS ;; split the four character ".dat" extension into a new variable SETRIGHT extension = filename 4 /split ;; build the new file name SET filename = "C:\destination\folder\" + filename + "_" + %date + extension RENAME %nextfile filename IFERROR RETURN GOTO loop