+ Post New Thread
Results 1 to 3 of 3
Scripts Thread, Help with drive mapping script edit in Coding and Web Development; Hi, I am not very experienced in scripting, and this part of a vbs logon script (below) was written by ...
  1. #1
    Andie's Avatar
    Join Date
    Sep 2006
    Location
    Cambridgeshire
    Posts
    794
    Thank Post
    167
    Thanked 66 Times in 49 Posts
    Rep Power
    29

    Help with drive mapping script edit

    Hi,

    I am not very experienced in scripting, and this part of a vbs logon script (below) was written by IT providers (sadly no longer with us). I have two questions:

    1. I would like to add two more mapped drives. Can I just add to the script using the existing syntax on each section and increasing the drive letter and remote path numbers? Eg. DriveLetter2 = "P:"

    2. In the user's profile, we connect S: to the path for the user home folder. This path name is \\servername\LNM Data\User Data\Students\%USERNAME%. We also have folder redirection set up in GP. Do we still need the bit below that seems to be mapping S: to something different? If so, should I correct the path, or is this doing something different? Does this map a home folder if none is in the profile?


    '***********************

    ' Drive Map Sub-routine

    '***********************

    Sub MapDrives

    On Error Resume Next

    'DriveLetter0 = "S:"
    DriveLetter1 = "R:"

    'RemotePath0 = "\\servername\%USERNAME%"
    RemotePath1 = "\\servername\Resources$"

    'objNetwork.MapNetworkDrive DriveLetter0, RemotePath0
    objNetwork.MapNetworkDrive DriveLetter1, RemotePath1

    End Sub

    Thanks.

  2. #2

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    15,823
    Thank Post
    875
    Thanked 1,675 Times in 1,458 Posts
    Blog Entries
    12
    Rep Power
    444
    hi

    its just as simple as putting another line in like you said

    you might as well take the map drive for s: out. It has a ' in front this means its ignored by the script

    your new script will look like

    Code:
    '***********************
    ' Drive Map Sub-routine
    '***********************
    Sub MapDrives
     
    	On Error Resume Next
     
    	DriveLetter0 = "P:"
    	DriveLetter1 = "R:"
     
    	RemotePath0 = "\\servername\share" 
    	RemotePath1 = "\\servername\Resources$"
     
    	'objNetwork.MapNetworkDrive DriveLetter0, RemotePath0
    	objNetwork.MapNetworkDrive DriveLetter1, RemotePath1
    	End Sub

  3. Thanks to FN-GM from:

    Andie (6th October 2008)

  4. #3
    Andie's Avatar
    Join Date
    Sep 2006
    Location
    Cambridgeshire
    Posts
    794
    Thank Post
    167
    Thanked 66 Times in 49 Posts
    Rep Power
    29
    Quote Originally Posted by FN-GM View Post
    hi

    its just as simple as putting another line in like you said

    you might as well take the map drive for s: out. It has a ' in front this means its ignored by the script

    your new script will look like

    Code:
    '***********************
    ' Drive Map Sub-routine
    '***********************
    Sub MapDrives
     
    	On Error Resume Next
     
    	DriveLetter0 = "P:"
    	DriveLetter1 = "R:"
     
    	RemotePath0 = "\\servername\share" 
    	RemotePath1 = "\\servername\Resources$"
     
    	'objNetwork.MapNetworkDrive DriveLetter0, RemotePath0
    	objNetwork.MapNetworkDrive DriveLetter1, RemotePath1
    	End Sub
    Except, I would need to remove that single quote ' from the objNetwork line, yes?

SHARE:
+ Post New Thread

Similar Threads

  1. Citrix Client Drive Mapping
    By Geoff in forum Thin Client and Virtual Machines
    Replies: 15
    Last Post: 27th May 2009, 02:25 PM
  2. Mapping network drive without using Scripts
    By tazz in forum How do you do....it?
    Replies: 13
    Last Post: 5th October 2007, 03:18 PM
  3. Card Readers and Drive Mapping
    By mmoseley in forum Network and Classroom Management
    Replies: 12
    Last Post: 7th August 2007, 11:33 PM
  4. Mapping a Hidden Network Drive
    By BKGarry in forum Mac
    Replies: 1
    Last Post: 3rd March 2007, 08:24 PM
  5. mapping a drive to web folder in windows xp
    By russdev in forum Windows
    Replies: 1
    Last Post: 3rd October 2005, 08:31 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •