Have you actually checked that the computer doesn't think the drives are really being used? Maybe run something like this in your script to get a log of what drives it thinks are mapped.
 Code:
shell '%comspec% /c net use > c:\drives.txt'

Or maybe try unmapping all drives right before mapping.
 Code:
USE * /DELETE