Answered mapping a drive in a vb scipt

  • 19 февраля 2009 г. 17:33
     
     
     A user in a domain needs to map a drive and associate an lpt2 port to a printer on a server that is not in the domain. I'm not sure if that is possible but I tried to add this to our VB login script and it is not running. Any help would be appreciated. thanks in advance.

    wn.MapNetworkDrive "V:",\\server\share,"FALSE","user","password"

    do I have the correct syntax and all of the quotes in the right places?

Все ответы

  • 20 февраля 2009 г. 2:18
    Модератор
     
     
    The syntax looks fine. I'm assuming the share argument (\\server\share) is enclosed in quotes. However, if you have defined the share and NTFS permissions to give access to the user, you need not specify the user and password arguments in your script anymore (unless you are mapping with different credentials).

    Regards,

    Salvador Manaois III
    MCITP | Enterprise & Server Admin
    MCSE MCSA MCTS CIWA C|EH
    Bytes & Badz: http://badzmanaois.blogspot.com
  • 20 февраля 2009 г. 20:22
     
     Отвечено
    Dim objNetwork
    Set objNetwork = WScript.CreateObject("WScript.Network")
    strLocalDrive = "L:"
    strRemoteShare = "\\server\C$\C share"
    strPer = "FALSE"
    strUsr = "username"
    strPas = "password"
    objNetwork.MapNetworkDrive strLocalDrive, strRemoteShare, strPer, strUsr, strPas