Sign in to follow this  
Followers 0
Eddy_Erpel

Drivemapadd

8 posts in this topic

When I try to connect a share by using DriveMapAdd with using a wrong password I always get the @error=1 instead of @error=6.

Would be great if anyone can help me.

Share this post


Link to post
Share on other sites



can u post code here it will make helping easier...


_____________________________________________________"some people live for the rules, I live for exceptions"Wallpaper Changer - Easily Change Your Windows Wallpaper

Share this post


Link to post
Share on other sites

I hope it's helping:

$map = DriveMapAdd ("Y:", "\\server\share",0,"administrator","wrongpassword")
MsgBox("","",@error);Display error
if @error=6 Then
    MsgBox("","Wrong password","Wrong pw")
EndIf

Share this post


Link to post
Share on other sites

I hope it's helping:

$map = DriveMapAdd ("Y:", "\\server\share",0,"administrator","wrongpassword")
MsgBox("","",@error);Display error
if @error=6 Then
    MsgBox("","Wrong password","Wrong pw")
EndIf
Could it be that it is trying to login to server using a local administrator accout that does not have access rights to the server.


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

No, with the right password it works fine and get @error=0.

Share this post


Link to post
Share on other sites

No, with the right password it works fine and get @error=0.

I'm thinking maybe (not sure though) your code is to blame

$map = DriveMapAdd ("Y:", "\\server\share",0,"administrator","wrongpassword")
MsgBox("","",@error);Display error
if @error=6 Then
    MsgBox("","Wrong password","Wrong pw")
EndIf

at the if statement the @error probably indicates the error following msgbox function not the drive mapping function.

try this

$map = DriveMapAdd ("Y:", "\\server\share",0,"administrator","wrongpassword")
$mapping_err= @error
MsgBox("","",$mapping_err);Display error
if $mapping_err=6 Then
    MsgBox("","Wrong password","Wrong pw")
EndIf

I thought the @error resets everytime a new function is run or in other words, @error indicates the error from the last function and in your original code, your if statement would seem to valide on the error message of the msgbox function not the drivemapadd function.

again, im not too sure but i hope that helps.

-Blademonkey


---"Educate the Mind, Make Savage the Body" -Mao Tse Tung

Share this post


Link to post
Share on other sites

The msgbox-function would not generate any @error value (always 0).

I already tried without the msgbox.

Share this post


Link to post
Share on other sites

with

$map = DriveMapAdd ("Y:", "\\server\share",0,"administrator","wrongpassword")
$mapping_err= @error
MsgBox("","",$mapping_err);Display error
if $mapping_err=6 Then
    MsgBox("","Wrong password","Wrong pw")
EndIf

I get the code=1 in my system Windows XP/SP2

Share this post


Link to post
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
Sign in to follow this  
Followers 0