Jump to content

Drivemapadd


Recommended Posts

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.


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

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

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

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
 Share

  • Recently Browsing   0 members

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