re123 Posted March 1, 2012 Posted March 1, 2012 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..
Tonnie Posted March 1, 2012 Posted March 1, 2012 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.
Moderators JLogan3o13 Posted March 1, 2012 Moderators Posted March 1, 2012 (edited) 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 March 1, 2012 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!
Nine Posted March 1, 2012 Posted March 1, 2012 (edited) 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 March 1, 2012 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
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