You really haven't supplied sufficient information for anyone to understand the environment. for example, what do you mean by "If I log into the machine for whom the shares are local"? I would suggest that you add error checking and some logging into the script so that you have a documented timeline for each mapping etc. and have error data (@error, @Serror) to see if something has gone wrong.
_________________________
Home page: http://www.kixhelp.com/hb/