How to move mouse to current cursor position?

Recommended Posts

engineergrrl 0

engineergrrl 0

This seems like such an elementary question that I can't believe I'm asking this, but I've searched the forums and help docs and could not find an answer.

Here's the scenario: I have sent the Tab key several times, and an icon is now highlighted. Here's the issue: I need to move the mouse to that icon (i.e. the current cursor position). When I write tests to take this action on just one machine, I simply get the coordinates of the icon and use that. But I now need to run this test on many machines, of all different resolutions, so that will not work.

Link to post

Share on other sites

engineergrrl 0

engineergrrl 0

My one issue now: is there any way to bypass the UAC prompt that occurs here? AutoIt seems to get suspended when the UAC prompt appears, and so I have to manually select "Yes" to allow AutoIt to execute the script.

Share this post

Link to post

Share on other sites

engineergrrl 0

engineergrrl 0

You can create a scheduled task, and run it as highest priority...then you can execute with cmd line

schtasks /run /tn scheduled_taskname_you_created

Thank you so much!! This option worked . I really appreciate all of your help!

To be specific about what I did to get this working in Windows 8: I used the Task Scheduler tool (which for some reason in Win 8 only shows up in search if you search for "Schedule Task", weirdly, though the tool is actually still named Task Scheduler) to create a time-based task. I set it to "Run With Highest privileges". Then for my script, I began the script with #RequireAdmin, and then used the run() command to launch PowerShell.

Just figured I'd include these details here in case anyone else is also using Win 8 and does a search for a problem like this in the future.