darkzeus Posted April 13, 2010 Share Posted April 13, 2010 Dear All I try to make script automatically for uninstall avira free edition... here is the code .. Run("C:\Program Files\Avira\AntiVir Desktop\setup.exe /remove","",@SW_MINIMIZE) WinWait ("Setup of Avira Antivir Personal - Free Antivirus") WinActive ("Setup of Avira Antivir Personal - Free Antivirus") WinWaitActive ("Setup of Avira Antivir Personal - Free Antivirus") Send ("!Y") WinWait("Avira Antivir Personal - Free Antivirus", "Maintenance complete") WinActive ("Avira Antivir Personal - Free Antivirus", "Maintenance complete") WinWaitActive ("Avira Antivir Personal - Free Antivirus", "Maintenance complete") Send ("!R") Send ("{ENTER}") ; Close scan process ProcessWait("avirafree.exe") $PID = ProcessExists("avirafree.exe") If $PID Then ProcessClose($PID) EndIf the uninstaller running... but send key cannot work... anyone help me??? Link to comment Share on other sites More sharing options...
JohnOne Posted April 13, 2010 Share Posted April 13, 2010 I would have thought that an antivirus/firewall program would strongly resist automation, for obvious reasons. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Spiider11 Posted April 13, 2010 Share Posted April 13, 2010 Have you tried ControlSend() , from waht i know should work better , or use ControlClick() to click the buttons. Link to comment Share on other sites More sharing options...
MHz Posted April 13, 2010 Share Posted April 13, 2010 It may work better if you change WinActive to WinActivate. Link to comment Share on other sites More sharing options...
darkzeus Posted April 13, 2010 Author Share Posted April 13, 2010 (edited) It may work better if you change WinActive to WinActivate. i try to change this script... #cs ---------------------------------------------------------------------------- Author: darkzeus Avira AntiVir PersonalEdition Classic 7.06.00.270 Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here ; Run the installer Run("C:\Program Files\Avira\AntiVir Desktop\setup.exe /remove","",@SW_MINIMIZE) WinWait ("[#32770:Setup of Avira Antivir Personal - Free Antivirus]") WinActive ("[#32770:Setup of Avira Antivir Personal - Free Antivirus]") WinWaitActive ("[#32770:Setup of Avira Antivir Personal - Free Antivirus]") Send ("!Y") sleep (6000) WinWait ("[#32770:Avira Antivir Personal - Free Antivirus]") WinActive ("[#32770:Avira Antivir Personal - Free Antivirus]") if WinWaitActive ("[#32770:Avira Antivir Personal - Free Antivirus]","","Button1") then ControlSend("[Button:Button1]", "", "1", "&Restart Computer") ControlClick("[#32770:Avira Antivir Personal - Free Antivirus]","","Button1") Send ("{ENTER}") endif ; Close scan process ProcessWait("avirafree.exe") $PID = ProcessExists("avirafree.exe") If $PID Then ProcessClose($PID) EndIf EXIT here's the code... its work!!!! but i have a new problem... ControlSend("[Button:Button1]", "", "1", "&Restart Computer") ControlClick("[#32770:Avira Antivir Personal - Free Antivirus]","","Button1") Send ("{ENTER}") this code cannot sent key stroke... sorry for my dump question.... this my screenshoot program.. i try to change restart ---> no restart when i send {ENTER} its not work... any advice????? Edited April 13, 2010 by darkzeus Link to comment Share on other sites More sharing options...
MHz Posted April 13, 2010 Share Posted April 13, 2010 I got the 2 windows to work with this: $title = 'Setup of Avira AntiVir Personal - Free Antivirus' $text = 'Do you want to completely remove the selected application and all its components?' WinWait($title, $text) WinActivate($title, $text); likes active focus before click WinWaitActive($title, $text) ControlClick($title, $text, 'Button1'); &Yes $title = 'Avira AntiVir Personal - Free Antivirus' $text = 'Press Finish to end maintenance operations.' WinWait($title, $text) ControlCommand($title, $text, 'Button1', 'UnCheck'); &Restart computer ControlClick($title, $text, 'Button4'); Finish It is the latest version of Avira on their website if it matters. Link to comment Share on other sites More sharing options...
darkzeus Posted April 14, 2010 Author Share Posted April 14, 2010 I got the 2 windows to work with this: $title = 'Setup of Avira AntiVir Personal - Free Antivirus' $text = 'Do you want to completely remove the selected application and all its components?' WinWait($title, $text) WinActivate($title, $text); likes active focus before click WinWaitActive($title, $text) ControlClick($title, $text, 'Button1'); &Yes $title = 'Avira AntiVir Personal - Free Antivirus' $text = 'Press Finish to end maintenance operations.' WinWait($title, $text) ControlCommand($title, $text, 'Button1', 'UnCheck'); &Restart computer ControlClick($title, $text, 'Button4'); Finish It is the latest version of Avira on their website if it matters. wow thanks!!! i'll try it.... Link to comment Share on other sites More sharing options...
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