The purpose of the script is to automate the uninstall of Huorong Internet Security antivirus. The .exe uninstaller does not support any /silent or bulk uninstall switch so I had to use AutoIt to automate. Below is the basic script.
The script will wait for the Uninstall window to appear and then click on the “uninstall” button based on the X,Y coordinates (There is no Control ID or text visible using the AutoIT window info, so the only option left is to use X Y).
;Wait for the uninstall window to appear
WinWait("Uninstalling")
; Activate the window
WinActivate("Uninstalling")
;Sleep(2000)
#RequireAdmin
; Send a mouse click at coordinates
ControlClick("Uninstalling", "", "", "primary", 10, 247 ,248)
The installer has 2 buttons “uninstall” and “cancel”. When I set the coordinate to Cancel the code works perfectly, but when I adjust the coordinate to “Uninstall” nothing happened.
The uninstaller Window
I tried to use the Mouseclick instead of ControlClick, but Mouseclick would not focus on the Uninstall windows. Therefore, I was not able to use coordinate to click. Also tried to adjust the coordinate to minimize and close window button, it will also work. Only the “Uninstall” button is having issue.
2