Eddy_Erpel Posted May 17, 2006 Share Posted May 17, 2006 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. Link to comment Share on other sites More sharing options...
Don N Posted May 17, 2006 Share Posted May 17, 2006 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 Link to comment Share on other sites More sharing options...
Eddy_Erpel Posted May 17, 2006 Author Share Posted May 17, 2006 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 Link to comment Share on other sites More sharing options...
BigDod Posted May 17, 2006 Share Posted May 17, 2006 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") EndIfCould it be that it is trying to login to server using a local administrator accout that does not have access rights to the server. 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 Link to comment Share on other sites More sharing options...
Eddy_Erpel Posted May 17, 2006 Author Share Posted May 17, 2006 No, with the right password it works fine and get @error=0. Link to comment Share on other sites More sharing options...
blademonkey Posted May 17, 2006 Share Posted May 17, 2006 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 Link to comment Share on other sites More sharing options...
Eddy_Erpel Posted May 17, 2006 Author Share Posted May 17, 2006 The msgbox-function would not generate any @error value (always 0). I already tried without the msgbox. Link to comment Share on other sites More sharing options...
jpm Posted May 18, 2006 Share Posted May 18, 2006 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 Link to comment Share on other sites More sharing options...
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