Jump to content

Send key not working in system account for first time


Recommended Posts

Hi,

I am new to autoit.I need to pass the username in the dialog box and click "Next".

But whn i run the script for the first time in the system account, its not taking the username and script stops there.When i run again the script it takes the entry and works fine.

Why is it happening? How to resolve this issue?

I have pasted the part of the script how am passing the variable :

WinWaitActive ("Setup")

Send("$myvar{ENTER}")

Please let me know why is this happening..

Link to comment
Share on other sites

  • Moderators

Hi, re123. Can you please post the portion of your code that you're having problems with? My first question is what is the value of $myvar? Are you using the @UserName macro to gather this? If so, running as the System account is not going to pulled the logged in user's name. You'd have to do a conversion through a WMI call.

Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

your code will never work, and its not because you

got the active window up that the cursor is positionned at

the right place...try this..

WinWaitActive("Setup")
MouseClick ("left", $x, $y, 1, 0)
Sleep (250)
Send($myvar)
Send("{ENTER}")

where $x and $y is the position of the entry box

Edited by Nine
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...