Mapped drives are per user profile. When you RunAs you're using the Administrator profile; that may not have the same drive mappings as the normal user.
On a network it's worth remembering that this Administrator profile is a
local administrator, not the Domain administrator for machines on a Windows domain. That account likely has no specific privileges to domain resources. I haven't tested to see if it has access to resources open to "Domain Users" or similar security groups. If you have to access network resources you may have to map them at the start of the batch file with appropriate NET USE commands.
Using UNCs can get around the issue of drive mappings not existing but you might still run into privilege issues. Using NET USE with the optional account/password parameters can work around these.
>Hi Al,
>
>Actually that does work - I had a work term student working on this and he said he could not get it working but I thought I should try again. What I found out is that he had the batch file on a mapped drive and it appears that mapped drives do not work once you go to elevated privileges. I noticed that I could not switch to mapped drives from the elevated command prompt so that gave me a clue.
>
>Thanks,
>Albert
>
>
>>
>>Just a guess, but if you run a batch/CMD file in an elevated CMD prompt (CMD.EXE...Run as administrator) that may give you the privileges you need.
Regards. Al
"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov
Neither a despot, nor a doormat, be
Every app wants to be a database app when it grows up