Does anyone have a list of the potential error codes that the WScript.Network.MapNetworkDrive method can return? I am trying to enhance our login scripts and want to put in some error checking (specifically for password errors).
I can't give you the answear to that... I'm sure a table exists, however... You can try to twist the question a bit. Do you need to know it everything that can possibly go wrong? or Do you need to know what went wrong?
If the answear is No/Yes, you can use the err object to find out what went wrong. Here's an example
Code:
If err.number <> 0 Then
wscript.echo "Error number : " & err.number & " . Description : " & err.description
End If
What I was looking for is to trap when an incorrect password is entered - I think I got a way using the err.number <> 0 and "cannot be found." is NOT in err.description. But I'm still looking for something!
If you enter a wrong password during a network connect session, you will raise an error wich is <> 0. I would not reccomend using another query due to the fact that you will not catch other errors.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.