Jump to content
Sign in to follow this  
re123

Send key not working in system account for first time

Recommended Posts

re123

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

Share this post


Link to post
Share on other sites
Tonnie

Maybe try:

WinWaitActive("Setup")
Send($myvar)
Send("{ENTER}")

I don't use the double quotes when using a variable with the send command, because the variable is already returning a string.

Share this post


Link to post
Share on other sites
re123

Yep i tried it already..tht too not working :oops:

Share this post


Link to post
Share on other sites
JLogan3o13

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

√-1 2^3 ∑ π, and it was delicious!

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites
Nine

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

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  

×