WellingtonIS
asked on
VB script gone wrong?
I wrote a VB script to map an M drive for each user. I have it in a gpo as a login script.
Option Explicit
On Error Resume Next
Dim objMapThis
Dim strAPDrive, strAPPath
strAPDrive = "M:"
strAPPath = "\\servername\wrmc-ap"
Set objMapThis = WScript.CreateObject("WScript.Network")
objMapThis.MapNetworkDrive strAPDrive, strAPPath
For reasons unknown it keeps mapping M:\users and I don't know why I have in AD a profile which maps an N drive to a user on the same server but its \\xxxx\users\username..
Would I be better off just using Net use?
Option Explicit
On Error Resume Next
Dim objMapThis
Dim strAPDrive, strAPPath
strAPDrive = "M:"
strAPPath = "\\servername\wrmc-ap"
Set objMapThis = WScript.CreateObject("WScript.Network")
objMapThis.MapNetworkDrive strAPDrive, strAPPath
For reasons unknown it keeps mapping M:\users and I don't know why I have in AD a profile which maps an N drive to a user on the same server but its \\xxxx\users\username..
Would I be better off just using Net use?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The GPO is a login script to map the drive. The shortcut is on the desktop because the users can't figure out how to find it so easier to create a shortcut. The script is in the GPO sorry if that's not clear. As for the "N" drive - that's separate and in the profiles What's happening is for some reason even though I have the login script mapping to that "M" drive \\server\share it's mapping to \\server\users which is the profile mapping...
Do you have any group policies that map drives for you directly (there's really no need for scripts to map drives; just use Group Policy preferences).