Announcement

Collapse
No announcement yet.

Simple Logon script to map drives does not always work on restart

Collapse
This topic is closed.
X
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Simple Logon script to map drives does not always work on restart

    I have a very simple VB login script assigned to all my users via their AD profile (the DC is running server 2003). It seems that when a users restarts or does a fresh startup, the script does not always map the drives upon login. If the user logs off and then back on again when this happens, the script then properly maps the drives.
    Does anyone have any idea as to why this happens sometimes but not all the time?
    Here is the script I use:


    'Purpose of script is to map network drives
    '*******************************************
    Dim objNet
    set objNet = CreateObject("wscript.Network")

    objNet.MapNetworkDrive "G:", "\\server1\ttshared"
    objNet.MapNetworkDrive "R:", "\\server1\SMP5"
    WScript.Quit

    'End Of Script

    Thanks in advance for any help

    Backspace
    Hindsight is 20/20 foresight is what matters

  • #2
    Re: Simple Logon script to map drives does not always work on restart

    Not that this is a solution to your problem, but i always remove the mapping before applying a new mapping. ie: removing the mappings on logoff or removing the drives in the lines before the mapping like below:
    on error resume next
    Set clDrives = WshNetwork.EnumNetworkDrives
    For i = 0 to clDrives.Count - 1 Step 2
    WSHNetwork.RemoveNetworkDrive cldrives.Item(i), True, True
    next
    wscript.sleep 300

    'Go onto your normal mapping

    Note: You will need to modify the above to suit your script but that is the basic idea

    Comment

    Working...
    X