Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I use this logon script in the user profile to map network drives. It works great for XP even Vista, Windows 7 not so much. If I run this manually at login it works fine. does anyone know what im doing wrong....:confused:

Option Explicit
Dim objNetwork, strRemotePath1, strRemotePath2, strRemotePath3
Dim strDriveLetter1, strDriveLetter2, strDriveLetter3

strDriveLetter1 = "G:"
strDriveLetter2 = "R:"
strDriveLetter3 = "T:"
strRemotePath1 = "\\stormwind\group"
strRemotePath2 = "\\stormwind\ITD"
strRemotePath3 = "\\stormwind\JDLInfo"

Set objNetwork = CreateObject("WScript.Network")

' Section which maps drives, G: and R:, and T:
objNetwork.MapNetworkDrive strDriveLetter1, strRemotePath1
objNetwork.MapNetworkDrive strDriveLetter2, strRemotePath2
objNetwork.MapNetworkDrive strDriveLetter3, strRemotePath3


Wscript.Quit
Posted
Updated 29-Dec-09 7:25am
v3

1 solution

This sounds like a UAC issue. Logon scripts run as administrator (using an administrative access token). After login, un-elevated actions run with a standard access token, so cannot see the mapped drives.

There are three potential solutions:

1) Disable UAC (really NOT recommended).

2) Microsoft lists a workaround at http://support.microsoft.com/default.aspx/kb/937624 that addresses this issue. This workaround does pose a security risk, but nowhere near as bad as disabling UAC.

3) The drives could be mapped using Group Policy Preferences instead of a login script.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900