General discussion

  • Creator
    Topic
  • #2285246

    VB script problem

    Locked

    by tamj123 ·

    Hi,

    Is there any way include user name with password to map a network share in VB script. example: username: mejhone password: support, network shard: \\csg_app\merchshare

    can this be done?

    Thank you.

All Comments

  • Author
    Replies
    • #3313138

      Reply To: VB script problem

      by p.j.hutchison ·

      In reply to VB script problem

      No I would not recommend to do it that way. Best way is to assign permissions on ther server to allow users access to shares and then map the drive normally.

      • #3311531

        Reply To: VB script problem

        by tamj123 ·

        In reply to Reply To: VB script problem

        I know it is not a good idea to do this, I have my reason to do this way.

    • #3311477

      Reply To: VB script problem

      by rewrite ·

      In reply to VB script problem

      • #3311532

        Reply To: VB script problem

        by tamj123 ·

        In reply to Reply To: VB script problem

        not what i asking. i need this to be part of my vb login script.

    • #3305163

      Reply To: VB script problem

      by clark_nick2002 ·

      In reply to VB script problem

      If you put this in your logon script it should do what you want.

      Dim WshNetwork
      Set WshNetwork = WScript.CreateObject(“WScript.Network”)
      WshNetwork.MapNetworkDrive “E:”, “\\Your_Server\share_name”

      This will use the username and password of the user who is logging on.
      you can put “username@domain”,”password” at the end if you want.

      i.e. if you wish to map a share user2 can access but user1 can’t to user1’s account do the following in user1’s logon script

      Dim WshNetwork
      Set WshNetwork = WScript.CreateObject(“WScript.Network”)
      WshNetwork.MapNetworkDrive “E:”, “\\Your_Server\share_name”,”user2@domain”,”user2_password”

      Good luck

    • #3100452

      Reply To: VB script problem

      by tamj123 ·

      In reply to VB script problem

      This question was closed by the author

Viewing 3 reply threads