workingdir "C:\path\to\files" archivedir "C:\archive\path" :top getnextfile "*.mpg" /oldest iferror return $ERROR_SUCCESS ftplogon "my_web_site" sendfile %nextfile /archive IFERROR RETURN *********************** * Update the RSS feed * *********************** SET filedatetime = %nextfiledatetime DATETIMESUB filedatetime 5 /hour ;; Get time in GMT ;; need to convert Sat Feb 17 11.00.22 2001 format to Mon, 21 Sep 2009 13:00:00 GMT format SETLEFT DDD = filedatetime 3 SETMID MMM = filedatetime 3 5 SETMID dd = filedatetime 2 9 SETMID hh = filedatetime 2 12 SETMID mm = filedatetime 2 15 SETMID ss = filedatetime 2 18 SETRIGHT YYYY = filedatetime 4 SET day_date = DDD + ', ' + dd + ' ' SET month_year = MMM + ' ' + YYYY + ' ' SET hhmm = hh + ':' + mm + ':' SET ssGMT = ss + ' GMT' SET timestamp = day_date + month_year + hhmm + ssGMT * Keep a local copy of the RSS feed without the last two lines SET rss_file = "c:\rss\incomplete_rss_file.xml" SET complete_rss_file = "c:\rss\rss.xml" WRITEFILE rss_file '' /append SET title = '' + %nextfile + '' WRITEFILE rss_file title /append SET description = '' + %nextfile + '' WRITEFILE rss_file description /append SET pubdate = '' + timestamp + '' WRITEFILE rss_file pubdate /append SET enclosure = '' WRITEFILE rss_file enclosure /append SET guid = 'http://mysite.com/' + %nextfile + '' WRITEFILE rss_file guid /append WRITEFILE rss_file '' /append COPY rss_file complete_rss_file WRITEFILE complete_rss_file '' /append WRITEFILE complete_rss_file '' /append * Upload the updated RSS file * SENDFILE complete_rss_file IFERROR RETURN * loop back to the top to see if there are more files to send * goto top