Heloo forum. I need help with my script.
I need to check if network drive in my script is really maped (sometimes drive wont map, because password has been changed). My scipt tell me only if maping was sucesefull, but wscript.echo isn't displayed if maping fails. THX for any help
Set Nw = CreateObject("WScript.Network")
Dim iReturn
iReturn = Nw.MapNetworkDrive("X:","\\server\share", , "user" , "password")
If iReturn <> 0 Then
'wscript.echo "Runtime error : " & cstr(iReturn) & vbcrlf & "Drive mapping failed."
wscript.echo "Drive mapping failed."
Else
wscript.echo "Drive mapping done."
End If
I found this script there on a forum, I think it's yours tsuji, but I cant set it to work corectly.
I need to check if network drive in my script is really maped (sometimes drive wont map, because password has been changed). My scipt tell me only if maping was sucesefull, but wscript.echo isn't displayed if maping fails. THX for any help
Set Nw = CreateObject("WScript.Network")
Dim iReturn
iReturn = Nw.MapNetworkDrive("X:","\\server\share", , "user" , "password")
If iReturn <> 0 Then
'wscript.echo "Runtime error : " & cstr(iReturn) & vbcrlf & "Drive mapping failed."
wscript.echo "Drive mapping failed."
Else
wscript.echo "Drive mapping done."
End If
I found this script there on a forum, I think it's yours tsuji, but I cant set it to work corectly.