Post the code that you have.

If you've been cherry-picking bits out of the code I posted you may have a version which is no longer functional.

You can also try adding some diagnostic debug messages to see what is going on. A good example would be the MapDrive() function:
Code:
Function MapDrive($d,$p)
"[DEBUG] Mapping '"+$d+"' to '"+$p+"'"+@CRLF
Use $d /delete /persistent
Use $d $p
$MapDrive=@ERROR
"[DEBUG] MapDrive exit status is:"+@CRLF
" "+@ERROR+": "+@SERROR+@CRLF
Exit $MapDrive
EndFunction