Improved batch script for auto-generated filenames