Jump to content



Photo

VB Scripting Question?


  • Please log in to reply
2 replies to this topic

#1 JMcClainMI

JMcClainMI

    Neowinian

  • Joined: 24-October 11

Posted 14 December 2012 - 15:59

I am trying to create a VB script that will help map network drives. I can get single drive mappings to map no problems but when I try to do this for multiple drive mappings it errors out on me? also try to make it where if there is an existing drive drive letter assigned to ignore and continue on with the mappings? Listed below is the script that I have been working with - Thanks in advance for looking at this...

Dim objNetwork
Dim strDriveLetter, strRemotePath
strDriveLetter = "F:"
strRemotePath = "\\Network share drive\"

' Purpose of script to create a network object. (objNetwork)
' Then to apply the MapNetworkDrive method. Result J: drive
Set objNetwork = CreateObject("WScript.Network")

objNetwork.MapNetworkDrive strDriveLetter, strRemotePath
WScript.Quit

' End of Example VBScript.



msgbox "Done, click OK"


#2 jake1eye

jake1eye

    Neowinian

  • Joined: 02-April 03
  • Location: New Westminster

Posted 14 December 2012 - 20:51

Here read this http://www.neowin.ne...#entry593272700 it a thread about
vbs and map drives.

#3 OP JMcClainMI

JMcClainMI

    Neowinian

  • Joined: 24-October 11

Posted 17 December 2012 - 13:48

Here read this http://www.neowin.ne...#entry593272700 it a thread about
vbs and map drives.


Great Thanks, I will look this over and see if this will help. Appreciate the assistance for this.