Sign in to follow this  
Followers 0
Bertman

Runasset And Errorhandling

3 posts in this topic

Hello,

I'm using the RunAsSet function, this works fine. But when a user gives the wrong password you will get an error (Logon Failure: unknown User name or bad password).

What I want is this.

1. Get loginscreen

2. Check if pass is correct, if not goto step 1

3. Do something

1 and 3 are working, but I want an errorhandling like step 2.

Bert

Share this post


Link to post
Share on other sites



Looking in the AutoIt help file you can find that there's an option the suppress the hard error when a Run function fails. If you use this combined with a known EXE (I've used RUNDLL32.EXE in the past) you can test for success of credentials by success of the Run function.


Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Here's an example :

AutoItSetOption ( "RunErrorsFatal", 0 )
RunAsSet($codeusager, @Computername, $passwd)

    $pid=Run ( 'C:\Program Files\Internet Explorer\iexplore.exe c:\', 'C:\Program Files\Internet Explorer' )
    If $pid = 0 Then
        MsgBox(4096,"Mot de passe invalide","The password is invalid")
        Exit
    EndIf
RunAsSet()
Edited by Wolfmorder

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