MouseMove and LClick not working

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
bfain
Newbie
Posts: 3
Joined: Sat Sep 30, 2006 2:54 pm

MouseMove and LClick not working

Post by bfain » Tue Jun 13, 2017 4:18 pm

I am having trouble trying to get, what I think, is a simple script to work. The script is being written to automate the uninstall of a program from client machines. I am writing the script on a Windows 7 VM running on VMware Workstation 12 Pro. I have compiled the script and tried it on a physical client with the same results.

Code: Select all

ExecuteFile>runas.exe,/user:admin "C:\Program Files (x86)\InstallShield Installation Information\{2AC77847-6E50-419D-B12C-693461BF3290}\setup.exe -runfromtemp -l0x0409  -removeonly"
Wait>1
Let>SK_IGNORECAPS=0
SendText>*******
Press Enter
Wait>15

FindImagePos>snapshot_0.png,SCREEN,0,0,XArr,YArr,NumFound,CCOEFF

Let>mXPos=%XArr_0% + 431
Let>mYPos=%YArr_0% + 117
MouseMove>mXPos,mYPos
LClick
Everything is working until it gets to the MouseMove. I do not see the mouse move. If the mouse is moving, I am not seeing the LClick work. The code as it is written is trying to click a "No" button. The mXPos and the mYPos variables have the correct position saved.

Any help with this would be greatly appreciated.

Brian

zabros2020
Pro Scripter
Posts: 70
Joined: Sun May 03, 2009 11:49 pm
Location: AU

Re: MouseMove and LClick not working

Post by zabros2020 » Thu Jun 15, 2017 1:45 am

I've seen a similar issue occur when i do support for automations.
Usually i have the user share their screen, as soon a a windows pop executes, if i have control. I cannot click it.

You may be experiencing a similar issue.

Maybe try using a SetFocus> using window handle or try click the object itself by using UIClick>
Loving MS's Capabilities!!!

bfain
Newbie
Posts: 3
Joined: Sat Sep 30, 2006 2:54 pm

Re: MouseMove and LClick not working

Post by bfain » Thu Jun 15, 2017 2:37 pm

OK, I got it to work the way it is written by running the MS executable as administrator. Is there another way around this? From what I see when it runs, anything to do with the mouse is blocked if it is not ran as administrator.

Brian

User avatar
CyberCitizen
Automation Wizard
Posts: 721
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Re: MouseMove and LClick not working

Post by CyberCitizen » Tue Jun 20, 2017 1:18 pm

Your Using The RunAs To Elevate The Process To An Admin Process, By Default A User Level Program Can Not Control An Administrator Program, This Is By Design / Security Within Windows.

As zabros2020 mentioned this can be experienced via remote control where the user is a standard user account / remote control running as that and it needs to access a UAC windows running under a system account or admin account.

This is by design your only option is to run it as an admin if your wanting to interface with admin windows.
FIREFIGHTER

bfain
Newbie
Posts: 3
Joined: Sat Sep 30, 2006 2:54 pm

Re: MouseMove and LClick not working

Post by bfain » Tue Jun 20, 2017 1:23 pm

Thanks for the reply. That makes since but what if the user running the script is a local and domain administrator. Should I still need to run it this way?

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts