Jump to content

drivemapadd problem number5

Recommended Posts

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   = ""
$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
        $count += 1

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)

    MsgBox (0, "Loginscript", "timeout. no contact with server")
Link to comment
Share on other sites

$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 by thor918
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...