Board index » Visual Studio » MapNetwork drive

MapNetwork drive

Visual Studio324
Hello



I'm currently mapping a network in my script, but what if that drive is not

onlone for some reason. How can I tell, so I can take the appropriate

action? Will that method return something I can branch off of?



Thanks


-
 

Re:MapNetwork drive

You can check the Err object:





On Error Resume Next



Set WshNetwork = WScript.CreateObject("WScript.Network")

WshNetwork.MapNetworkDrive "G:", "\\Test\Test"

If Err.number <>0 Then

WScript.Echo Err.Description

End If



--

urkec





"Jason" wrote:



Quote
Hello



I'm currently mapping a network in my script, but what if that drive is not

onlone for some reason. How can I tell, so I can take the appropriate

action? Will that method return something I can branch off of?



Thanks







-