Page 1 of 1 1
Topic Options
#203351 - 2011-10-24 05:20 PM Drive mapping, Windows 7 x64 and UAC
disti Offline
Just in Town

Registered: 2006-02-19
Posts: 2
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

Top
#203354 - 2011-10-24 05:36 PM Re: Drive mapping, Windows 7 x64 and UAC [Re: disti]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4545
Loc: USA
Let me guess, is this a GPO Startup Script?
Top
#203357 - 2011-10-24 06:34 PM Re: Drive mapping, Windows 7 x64 and UAC [Re: Allen]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
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

Top
#203358 - 2011-10-24 06:49 PM Re: Drive mapping, Windows 7 x64 and UAC [Re: ShaneEP]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4545
Loc: USA
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


Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 382 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.05 seconds in which 0.022 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org