you'd need an utility like
http://www.techeez.com/download/obslt10.zip and then add a line to your .bat file generator, something like
<path_to>obsolete -s 5 minutes <pattern> c:\path\where\files\are\generated
You will have to replace path_to with a path to the utility and <pattern> with a pattern you will be deleting. It will delete all files older than 5 minutes at the location you specify which match the pattern. You may want to test what you'll be deleting first by using -n instead of -s.
Merging all files into one right now is not possible, you can only create a .php file for use in webserver which will read all individual server files and display them on one page. I won't give you code for that, try google, since it involves many things totally unrelated to agsm.