Jump to content

RunAsSet user verification


gleem
 Share

Recommended Posts

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

  • Developers

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

  • 2 months later...

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 by LoWang
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...