disti
(Just in Town)
2011-10-24 05:20 PM
Drive mapping, Windows 7 x64 and UAC

Hi,

on a customer's domain I'm running this script (stripped to show the relevant code only - the stripped version gives the same results as the full one):

 Code:
dim $BaseSharesPath
$BaseSharesPath = "\\myserver"

"Mapping folder for " 
color w+/n
@UserID 
color w/n 
" ... "
if exist($BaseSharesPath + "\" + @UserID)
	use s: /delete
	use s: $BaseSharesPath + "\" + @UserID
	if @error = 0
		color g+/n
		"OK"
	else
		color r+/n
		"ERROR"
	endif
else
	color y+/n	
	"NOT FOUND"
endif

sleep(2)


On Windows XP the script runs fine.

On Windows 7 (I tried it on x64 but it's supposed to have the same behavour on x86) with UAC on (default level) the script seems to run, I can see the output and no error is given on the mapping command (I can see "OK" on the console).

However, when the logon process is finished I can't see the mapped drive on Computer window.

The really strange thing is that if I run the script again once logged on, the very same output is given, and this time the mapped drive is shown.

If I turn off UAC everything works as expected during the logon process, too.

Does someone have an idea of what's goin on?

Thank you,

Roberto


AllenAdministrator
(KiX Supporter)
2011-10-24 05:36 PM
Re: Drive mapping, Windows 7 x64 and UAC

Let me guess, is this a GPO Startup Script?

ShaneEP
(MM club member)
2011-10-24 06:34 PM
Re: Drive mapping, Windows 7 x64 and UAC

Try adding this before mapping...
 Code:
$nul = WriteValue("HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System","EnableLinkedConnections",1,"REG_DWORD")


http://support.microsoft.com/kb/937624


AllenAdministrator
(KiX Supporter)
2011-10-24 06:49 PM
Re: Drive mapping, Windows 7 x64 and UAC

Well you can suggest that, but it's not supported by Microsoft. I not saying it wrong, but I was going to give him the option of this or the RunAsInteractiveUser() UDF.

RunAsInteractiveUser() - http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=198514#Post198514

How to use UDFs -
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=81943#Post81943

The rest of the UDFs are here -
http://www.kixtart.org/forums/ubbthreads.php?ubb=postlist&Board=7&page=1