Link to home
Start Free TrialLog in
Avatar of WellingtonIS
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?





Avatar of Lee W, MVP
Lee W, MVP
Flag of United States of America image

Do you specify the user's home drive in their profile?
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).
ASKER CERTIFIED SOLUTION
Avatar of ste5an
ste5an
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of WellingtonIS
WellingtonIS

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...