MapDrive() is not a built-in function. Can you post which UDF is in your script? This would be something like:
 Code:
Function MapDrive($arg, $arg...)
  commands...
EndFunction
There are a couple of functions in the library with the same name. Most return error results that your code isn't checking for. That would certainly provide more insight into the problem.

Simple/Quick test? Add "@SERROR @CRLF" after each MapDrive() function call to see the error message that's being returned.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D