I ran into something similar with batch DXF → DWG.
One thing to watch is SAVE vs SAVEAS — in batch, SAVE doesn’t always behave as expected, especially if the drawing has no proper name yet.
Also, FILEDIA needs to be set to 0 or the process can stop on dialogs.
For small batches, the LISP solutions above should work fine.
For larger batches, I found using accoreconsole with a simple script more reliable.