I have a VBS script that uses calibredb to export (copy) the epubs into a single flat folder, and the azw3 into another single flat folder
Code:
calibredb export --all --dont-save-cover --dont-update-metadata --dont-write-opf --format azw3 --single-dir --template "{authors} - {title}" --to-dir .....
http://manual.calibre-ebook.com/cli/calibredb.html
The script might not be exactly what you're looking for, but checkout the calibredb program