Networkmapping script (VBS) Vista doesn't work, XP does
- by The_cobra666
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!