gleem Posted May 30, 2007 Share Posted May 30, 2007 I have been searching through the forums for a way to do verify the RunAsSet command with an If then Statement. for example... as I understand it.. normally, you would use RunAsSet("username","domain","password",2) Run("C:\Program Files\Internet Explorer\iexplore.exe") this would cause iexplorer.exe to run with the RunAsSet user account. however, if the user enters the password wrong and/or user name, the script still runs. what I would like to do is verify that domain user account and password is correct. If correct, it runs the script. if not, is exit's. I am sure this questions pertains more to an AD type verification but I am not sure how to do so. Link to comment Share on other sites More sharing options...
Richard Robertson Posted May 30, 2007 Share Posted May 30, 2007 You would have to understand the authentication protocol to validate information. AutoIt is great, but I'm not sure if it should be validating passwords or anything like that. I could see that blowing into a brute force user password cracker. Link to comment Share on other sites More sharing options...
dufran3 Posted May 31, 2007 Share Posted May 31, 2007 Can't you use the @error flag in this script? RunAsSet("username","domain","password",2) If @error Then Exit Run("C:\Program Files\Internet Explorer\iexplore.exe") ???? Link to comment Share on other sites More sharing options...
Developers Jos Posted May 31, 2007 Developers Share Posted May 31, 2007 Can't you use the @error flag in this script? RunAsSet("username","domain","password",2) If @error Then Exit Run("C:\Program Files\Internet Explorer\iexplore.exe") ????Did you test that because it doesn't work like that.. You need to test the Run/RunWait for an @Error because at that time the process is shelled with the newly set credentials . SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
LoWang Posted August 1, 2007 Share Posted August 1, 2007 (edited) Did you test that because it doesn't work like that..You need to test the Run/RunWait for an @Error because at that time the process is shelled with the newly set credentials .It's easy. You just run some cmd command like this: runasset(some credentials) runwait("cmd.exe /c time /t","",@SW_HIDE) $res1=@error if $res1 == 0 then ;credentials OK Edited August 1, 2007 by LoWang 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