![]() ![]() #ce - Func checkForImage ( ) While $counter2 < 1 search for the UAC in the entire screen - 2 screens supported local $searchUac = _ImageSearchArea ( 'UAC_ginloSetup.bmp', 1, - 2568, - 8, 5136, 1440, $x1, $y1, 0 ) If $searchUac = 1 Then if the UAC was found search for the Yes button in a an area 200 x 200 from the middle of the found UAC image local $searchYes = _ImageSearchArea ( 'UAC_Yes.bmp', 1, $x1, $y1, $x1 + 200, $y1 + 200, $x2, $y2, 0 ) If $searchYes = 1 Then if the Yes button was found click it and pause the script for $sleep seconds MouseClick ( "left", $x2, $y2, 1, 0 ) Sleep ( $sleep ) Else if the Yes button was not found retry from the beginning in $smallSleep seconds MsgBox ( 0, "UAC found error", "UAC was found but the 'Yes' button was not found. Here is my code, which works with virtualbox:Įxpand collapse popup #AutoIt3Wrapper_Icon= ".\uac.ico" #include FileInstall ( ".\ImageSearchDLL.dll", ".\ImageSearchDLL.dll", 0 ) FileInstall ( ".\UAC_ginloSetup.bmp", ".\UAC_ginloSetup.bmp", 0 ) FileInstall ( ".\UAC_Yes.bmp", ".\UAC_Yes.bmp", 0 ) set global variables for the coordinates, which should be delivered global $x1 = 0, $y1 = 0 global $x2 = 0, $y2 = 0 global $counter1 = 0 global $counter2 = 0 global $sleep = 10000 global $smallSleep = 5000 execute the script in a loop, so that it will hopefully recover from some unexpected errors While $counter1 < 1 ![]() I also noticed that while the cursor moves to the target which has to be cilcked when my vmware worstation window is not focused, it even doesn't do that when i WinActivate the vmware workstation window first.ĭid anyone experience such an issue, or maybe could give me a hint, what else i could use to send a key combination or a mouse click in a vmware workstation 14 pro guest window? Every attempt that i made to send clicks or keys from the host inside the VM did not work. I tried sending key combinations instead of a click, so that the VM can grab the input, but it also did not work. Since i switched to VMware Workstation 14, the script no longer clicks inside the VM successfully. ![]() It recognized the UAC prompt and clicked inside and the UAC was accepted. This script worked perfectly with virtual box. Both the host and the guest OS are Windows 10. I have an autoit script running on my host machine watching for the UAC prompt to be displayed in a running vm. I am writing to you after a very long struggle i had while trying to figure out how to send a simple click inside a virtual machine running in vmware workstation 14. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |