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
So this requires hardware to be setup in the area you want to listen to music in? And it requires hardware for each user?
So useless for me when I'm out walking my dog? Or when I'm at the gym and want to listen to my podcasts rather than the music the gym is broadcasting? Heck, will it even work in my own home and allow me to walk around from room to room, or even within a room?
Yeah, these won't be replacing headphones anytime soon.
Question
JMcClainMI
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"
Link to comment
https://www.neowin.net/forum/topic/1125760-vb-scripting-question/Share on other sites
2 answers to this question
Recommended Posts