Do not run the Compact -A with the compact -B, as these perform two totally different functions. Compact -a (-A) is to cause the server to archive specific files, while the Compact -B is an inplace compaction with file size reduction, ands this compact also changes teh DBIID, so if you have transaction logging enabled, this will also be effected.
As stated previosuly, you can use the Compact -a to archive and compact the file. If you want file size reduction, you should set a program document to run compact -B after the Archiving is complete. Also, if you use transaction logging with yuour backup, you will need to run the backup program as well.