Batch print only saves first 7 character in filename PDF

Batch print only saves the first 7 character in the filename of a PDF. That means that it overwrites files that start with the same 7 characters but have different characters after that.

For example:

"abcdefgcar.dwg" sheet1 and "abcdefgtree.dwg" sheet1 will save both as "abcdefg_sheet1.pdf" The last one overwrites the previous ones.

How to solve this?