Announcement

Collapse
No announcement yet.

Script to map network drive for single user

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

  • Script to map network drive for single user

    Hi everyone,
    I am very new to scripting.

    I'm wondering how I'd go about running a script to map a network drive for a single user.

    I.e. if username = jnuser
    then map \\servername\share

    Thanks in advance!

  • #2
    Re: Script to map network drive for single user

    Your basic script to map a drive letter is:

    net use x \\server\share

    x is your drive letter. It can be M or R or whatever you wish.

    Depending on how your share is setup, you can get away with this.

    Are you in a domain or workgroup?
    MCITP:SA, MCSA 2003, MCP, CCNA, A+, Net+, Security+

    Comment


    • #3
      Re: Script to map network drive for single user

      coreybird do you like a batch or vbscript for this? Both types can run as logonscript. Both types can do where you are looking for.

      boondock showed a batch sample. If you add a condition based on the current username to it, it will look something like:
      Code:
      @If /i [%username%]==[jnuser] ( net use x: "\\server\share" /persistent:No )
      Where X: is the driveletter, you can use any available driveletter. Or instead of the driveletter you can also type * .The system will now choose automatically the first available letter (starting from Z: ).


      \Rems

      This posting is provided "AS IS" with no warranties, and confers no rights.

      __________________

      ** Remember to give credit where credit's due **
      and leave Reputation Points for meaningful posts

      Comment


      • #4
        Re: Script to map network drive for single user

        If you have a windows 2000/03 domain you could also make the script part of a group policy object and apply it to the individual user (or even a group if you want to make future changes easier)

        Comment

        Working...
        X