I do not see where you are properly calling the MapDrv() function for different drives.

The functions requires two inputs "MapDrv($Drv, $Shr)". But you reference a global variable in the USE statement inside the MapDrv UDF. That should not be there.

USE $Drv $DFS + $Shr

All share info should be passed to the UDF when called.
_________________________
Home page: http://www.kixhelp.com/hb/