Logon script working but mapped drives not showing in My Computer
Windows Server 2003 R2/Windows 7 Client We use GPO's and every user has a vbs logon to map drives. However although the scripts work in XP they don't show any mapped drives in Win7. Below is a sample script Option Explicit Dim oWS, objNetwork Set oWS = WScript.CreateObject("WScript.Shell") Set objNetwork = CreateObject("Wscript.Network") ' Map Drives ' ---------- ' Map IT General Drive - I ' ------------------------ On Error Resume Next if objNetwork.ComputerName = "REL2519" then MsgBox "I Drive" End if objNetwork.MapNetworkDrive "I:", "\\company.org.uk\company\IT\IT General" if objNetwork.ComputerName = "REL2519" then MsgBox "I Drive Mapped" End if If (Err.Number <> 0) Then On Error GoTo 0 objNetwork.RemoveNetworkDrive "I:", True, True if objNetwork.ComputerName = "REL2519" then MsgBox "I Drive Removed" End if objNetwork.MapNetworkDrive "I:", "\\company.org.uk\company \IT\IT General" if objNetwork.ComputerName = "REL2519" then MsgBox "I Drive Re-mapped" End if End If Wscript.quit If I run this from the desktop then the script works fine.Has anything changed in Windows 7? PS the lines with Msgbox are for testing purposes. Thanks Tony
January 23rd, 2009 7:03pm

I was having trouble with Novell mapped drives and scripts. I accidentally found out that by turning off UAC they worked perfectly. Maybe give it a try. I'm sure it's not the magic bullet for all things. Turn it off, re-start and then try your scripts. It's in the action center. If it works at least you know that your scripts are working and your mapping is working. And if it doesn't, it only cost you a little time. Scott
Free Windows Admin Tool Kit Click here and download it now
January 23rd, 2009 8:00pm

If I remember correctly, logon scripts run at an administrative level. Until you elevate an action, you are running at a user level token. They cannot see each others drives. To test this, open a command prompt and type: net use Do you see any network drives listed? Next, open a command prompt "as administrator" (right click and select "run as administrator"). type: net use Do you see any network drives listed?
January 23rd, 2009 10:32pm

i was having the same problem earlier today and eventually got it to work, unfortunately I tried a few things in the last attempt that made it work and not sure which change fixed the problem. to flayofish: when i was in the GP it mentioned that the logon scripts run as the user.
Free Windows Admin Tool Kit Click here and download it now
January 24th, 2009 2:39am

I am having this issue. When I run the net use as administrator I see my drive mappings. How do I fix this?Thanks
October 21st, 2009 5:47pm

I to have the exact same issue. Various ways of mapping drives via a script doesn't work at logon. (manually running is fine)
Free Windows Admin Tool Kit Click here and download it now
November 19th, 2009 7:59am

Have found the problem and this is because the script is run elevated but the view in My Computer is not elevated (standard user). (so if you were not a member of administrators, it would appear to function normally) The "Group Policy Scripts can fail due to User Account Control" section here explains it: http://technet.microsoft.com/en-us/library/cc766208(WS.10).aspx There is a temporary not recommended workaround here: http://support.microsoft.com/default.aspx/kb/937624
November 19th, 2009 8:23am

Have found the problem and this is because the script is run elevated but the view in My Computer is not elevated (standard user). (so if you were not a member of administrators, it would appear to function normally) The "Group Policy Scripts can fail due to User Account Control" section here explains it: http://technet.microsoft.com/en-us/library/cc766208(WS.10).aspx There is a temporary not recommended workaround here: http://support.microsoft.com/default.aspx/kb/937624 Thanks a lot Matt, the steps described in this section solved the problem here (it was the same problem of the first post) ;)
Free Windows Admin Tool Kit Click here and download it now
April 27th, 2010 5:26pm

Sorry to dig up this thread but in my experience if you make the mapping permanent with objNetwork.MapNetworkDrive drive, share, True then it works without the registry fix mentioned. I noticed this after I changed my scripted mappings from permanent to non-permanent and my Windows 7 users who are local administrators started having problems. Standard users on Windows 7 don't experience this issue and XP is unaffected. Hope this helps someone.
June 3rd, 2011 6:19pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics