thor918 Posted April 17, 2007 Posted April 17, 2007 The thing is that I can't seem to give a reproducable code that gives away what's wrong, because the code works ok, and sometimes not... when it don't work it gives error code 5 = Invalid remote share the script is an UP script of openvpn. the script is executed when openvpn connection is attchived. The script is excuted by a Run("script/AutoIt3 script/up.au3") When I excute the code in the IDE, it seems to work every time.... $computer = "10.8.0.1" $timeout = 250 $maxlogintry = 5 $count = 0 ;Check if it is possible to connect to server While $count < 70; ca 7 sekunders timeout $pcFound = Ping($computer, $timeout) if $pcFound then ExitLoop Sleep(100) $count += 1 WEnd If $pcFound Then;Connection ;Mapping av nettverksstasjoner $username = 'ole' $password = 'Password2' $domain = 'seln.local' $Driveletter = DriveMapAdd("*", "\\win2003\felles", 0, $domain & "\" & $username, $password) MsgBox(4096, "Test", @error) Else MsgBox (0, "Loginscript", "timeout. no contact with server") EndIf
evilertoaster Posted April 17, 2007 Posted April 17, 2007 $Driveletter = DriveMapAdd("*", "\\win2003\felles", 0, $domain & "\" & $username, $password) Im guessing it breaks on that line? If so it may be exactly what the error is saying...maybe the machine you are trying to map to is off or unreachable from your network.
thor918 Posted April 17, 2007 Author Posted April 17, 2007 (edited) yes correct the error is cast when I map a nettworkdrive. but I find it strange that sometimes it work, and sometimes it does not... Edited April 17, 2007 by thor918
thor918 Posted April 17, 2007 Author Posted April 17, 2007 (edited) evilertoaster said: $Driveletter = DriveMapAdd("*", "\\win2003\felles", 0, $domain & "\" & $username, $password) Im guessing it breaks on that line? If so it may be exactly what the error is saying...maybe the machine you are trying to map to is off or unreachable from your network. Hmm I guess your right, seems my netbios name setup isn't as solid as I was expecting. changed \\win2003 to my \\ip and no error 5. strangly win2003 name works everytime I ping Edited April 17, 2007 by thor918
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now