Announcement

Collapse
No announcement yet.

logon script error - the local device name is alreay in use

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • logon script error - the local device name is alreay in use

    hi

    i have a logon script that map network drive
    including the user home folder
    when the user is logging on he recive this error

    "the local device name is alreay in use"

    this is the script

    Option Explicit

    Dim wshNetwork

    Dim objNetwork
    Dim strDriveLetter, strRemotePath, strUserName

    Set wshNetwork = CreateObject("Wscript.Network")

    wshNetwork.MapNetworkDrive "x:", "\\server_name\share_name"
    wshNetwork.MapNetworkDrive "o:", "\\server_name\share_name"
    wshNetwork.MapNetworkDrive "p:", "\\server_name\share_name"


    strDriveLetter = "y:"
    strRemotePath = "\\server_name\users"

    Set objNetwork = WScript.CreateObject("WScript.Network")

    strUserName = objNetwork.UserName
    'objNetwork.MapNetworkDrive strDriveLetter, strRemotePath _ & "\" &
    strUserName


    WScript.Quit

    thank for any replay
    zavik

  • #2
    Re: logon script error - the local device name is alreay in use

    Sounds like the user already has the drive mapped.

    try adding a command to remove a drive mapping before the actually mapping for the drives. Sorry but I dont know VB. This is how to do it via the cmd line:

    net use <drive letter>: /d

    Michael
    Michael Armstrong
    www.m80arm.co.uk
    MCITP: EA, MCTS, MCSE 2003, MCSA 2003: Messaging, CCA, VCP 3.5, 4, 5, VCAP5-DCD, VCAP5-DCA, ITIL, MCP, PGP Certified Technician

    ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

    Comment


    • #3
      Re: logon script error - the local device name is alreay in use

      Stop the script from running, log on and look at what drives are already mapped.
      Server 2000 MCP
      Development: ASP, ASP.Net, PHP, VB, VB.Net, MySQL, MSSQL - Check out my blog http://tonyyeb.blogspot.com

      ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

      Comment


      • #4
        Re: logon script error - the local device name is alreay in use

        hi there
        thanks for the replaies

        my mistake

        i was confused between the
        logon script and the home folder path
        in the user properties

        so beacuse it is that up there
        so i dont need it in the vbs.

        thanks again
        zavik

        Comment

        Working...
        X