:top ;; Find part 1 of the report and figure out the base name GETNEXTFILE "*_part1.dat" /timeout=0 SET part1 = %nextfile setextract basename = part1 "_part1.dat" 1 ;; Find the other 2 parts that have the same base name set part2 = basename + "_part2.dat" GETNEXTFILE part2 /timeout=0 set part3 = basename + "_part3.dat" GETNEXTFILE part3 /timeout=0 ;; Now that we are sure all three parts exist, zip and upload them set zipname = basename + ".zip" ZIP zipname part1 /create zip zipname part2 zip zipname part3 ;; Delete the files now that we have made our zip file delete part1 delete part2 delete part3 ;; Upload and delete the zip file ftplogon "mysite" SENDFILE zipname /delete ftplogoff ;; Go back to the top and watch for the next report goto top