I might have useful information that may or may not be related. It
may very well me UAC interfering, depending on how your
script/programs runs. Read this Knowledge Base article here:
http://support.microsoft.com/kb/937624/en-us
That article specifically addresses the NET USE command and UAC.
Microsoft provides a registry setting to counter that specific issue with
NET USE, but it will not help when the SUBST command is used to assign a UNC
path to a drive letter.
I uncovered a similar issue with the SUBST command and UAC enabled:
1. Log into Vista as an Admin, by default you are running everything
under the filtered security token.
2. Double-click the Command Prompt shortcut. This is the Limited
Prompt running under the filtered security token.
3. Right-click the Command Prompt shortcut, and select Run as Admin.
This is the Admin Prompt, running under the full administrator
security token.
4. OPTIONAL: In the Admin Prompt, issue the command COLOR 47.
This will make it easier to distinguish the two prompts.
5. In the Limited Prompt, use the SUBST command to assign a drive
letter to a UNC path. For Example: SUBST Q: \\Machine\Share\Path
6. In the Limited Prompt, issue the command Dir Q:\
EXPECTED RESULTS: A directory listing appears.
ACTUAL RESULTS: A directory listing appears.
7. In the Admin Prompt, issue the command Dir Q:\
EXPECTED RESULTS: A directory listing appears.
ACTUAL RESULTS: The system cannot find the path specified.
The same thing happens in reverse, if you use SUBST under an Admin
Prompt, it cannot be accessed under the Limited Prompt.
I called Microsoft about this issue last week and spent over 6 hours
on two different phone calls showing various members of their Network
team how the issue works. They all wanted to know about my network
and everything else. Noe fo that matters. It's really simple, UAC
doesn't hand off the substitutions between the two security tokens.
I received a voice mail message yesterday that it is a known issue
(though I can't find it in the Knowledge Base). And, if it will EVER
be addressed, it will be in Vista Service Pack 1. There was no
commitment that it will ever be addressed. Microsoft might not fix
this issue at all, if they consider Net Use is a viable workaround.
If your program uses the SUBST command, and later prompts the user
for UAC access, then subsequently the elevated process attempts to
access the substituted drive letter, it would appear as if the substitution
didn't work at all.
Hope this helps!