Sign in to follow this  
Followers 0
perryintokyo

Automatic login and exit

4 posts in this topic

Hi Everyone, I'm a new member here and just came across this forum. Wondering if anyone can give me a little help here:

I have a 3rd party application, says ABC.exe, when it starts, it pops up a login screen with 2 fields "userID" & "password", plus of course an "LOGIN/OK" button. I need to automate the startup/login and shutdown via a batch file. I assume AutoIT can handle this request easily; however I've been researching on this forum for few hrs but can't find what I need. Can anyone give me some directions plz? many thx... - Perry

Share this post


Link to post
Share on other sites



It doesn't get much more simple than that. Look at the following in the helpfile:

WinActive

ControlSend

ControlClick

Your code may end up looking something like this:

While 1
  If WinActive(<the login window>) Then
      ControlSend(<login window>,"",<username control>,<username>)
      ControlSend(<login window>,"",<password control>,<password>)
      ControlClick(<login window>,"",<login/ok button>)
      ExitLoop 
  EndIf
sleep(1000)
Wend

Share this post


Link to post
Share on other sites

Did you check to see if the executable has options that allow for a user name and password to passed to it? If not then above poster's example is good.

Share this post


Link to post
Share on other sites

Thanx to both of you. I've been reading the docs since yesterday, the more I know about AutoIT, the more I find it really powerful. Everything seems to make more sense now. Loving AutoIT now. cheers.

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