Networkmapping script (VBS) Vista doesn't work, XP does

Posted by The_cobra666 on Server Fault See other posts from Server Fault or by The_cobra666
Published on 2009-09-09T13:52:25Z Indexed on 2010/04/10 14:03 UTC
Read the original article Hit count: 473

Hi all,

I've got a weird problem, (like always :p )

Okay: Situation: Windows 2003 domain with XP clients. With a GPO I'm running a VBS script on login to map a few drives. This works great on XP, but not on Vista. If I manually run the script after the user has logged on, it works. So I know the script works on Vista, it just doesn't run via the GPO. The user has admin privileges.

I also have the same problem on Windows 7 RC1. So it must be related.

The script:

 on error resume next
Dim objNetwork
Dim strDriveLetter, strRemotePath, strUserName
strDriveLetter = "Z:"
strRemotePath = "\\Onsgeluk.ons_geluk.local\Profieldoc"
Set objNetwork = WScript.CreateObject("WScript.Network")
strUserName = objNetwork.UserName
objNetwork.RemoveNetworkDrive "Z:"
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath _
& "\" & strUserName
objNetwork.RemoveNetworkDrive "X:"
objNetwork.MapNetworkDrive "X:" , "\\Onsgeluk.ons_geluk.local\Data"
objNetwork.RemoveNetworkDrive "Y:"
objNetwork.MapNetworkDrive "Y:" , "\\Onsgeluk.ons_geluk.local\Mappen\hoofdverpleging"

Does anyone have a clue?

Thanks in advance guys (and girls)

ps: sorry for my bad english!

© Server Fault or respective owner

Related posts about windows-server-2003

Related posts about vbs