redfive19 0 Posted March 28, 2005 Guys, This is my first post here. I've searched and couldn't find a suitable answer to this question. I am trying to uninstall an HP printer. Half-way through the install, it prompts to remove shared files to which I would like to answer "Yes To All." Problem is, this doesn't happen everytime so I created an IF statement run("C:\Program Files\Hewlett-Packard\LaserJet 33xx\Uninstall\Setup.exe uninst.ini") WinWaitActive("Welcome", "&Next >") ControlClick("Welcome", "&Next >", "Button1") $YESTOALL = WinActive("Uninstall Wizard", "File Name:") If $YESTOALL = 1 Then Send("!E") WinWaitActive("Uninstall Wizard Complete", "&Finish") ControlClick("Uninstall Wizard Complete", "&Finish", "Button1") WinWaitActive("Uninstall Wizard", "No, I will restart my computer later.") ControlClick("Uninstall Wizard", "No, I will restart my computer later.", "Button3") ControlClick("Uninstall Wizard", "No, I will restart my computer later.", "Button5") Else WinWaitActive("Uninstall Wizard Complete", "&Finish") ControlClick("Uninstall Wizard Complete", "&Finish", "Button1") WinWaitActive("Uninstall Wizard", "No, I will restart my computer later.") ControlClick("Uninstall Wizard", "No, I will restart my computer later.", "Button3") ControlClick("Uninstall Wizard", "No, I will restart my computer later.", "Button5") Exit EndIf Exit I've also tried it like this: run("C:\Program Files\Hewlett-Packard\LaserJet 33xx\Uninstall\Setup.exe uninst.ini") WinWaitActive("Welcome", "&Next >") ControlClick("Welcome", "&Next >", "Button1") If WinActive("Uninstall Wizard", "File Name:") Then Send("!E") WinWaitActive("Uninstall Wizard Complete", "&Finish") ControlClick("Uninstall Wizard Complete", "&Finish", "Button1") WinWaitActive("Uninstall Wizard", "No, I will restart my computer later.") ControlClick("Uninstall Wizard", "No, I will restart my computer later.", "Button3") ControlClick("Uninstall Wizard", "No, I will restart my computer later.", "Button5") Else WinWaitActive("Uninstall Wizard Complete", "&Finish") ControlClick("Uninstall Wizard Complete", "&Finish", "Button1") WinWaitActive("Uninstall Wizard", "No, I will restart my computer later.") ControlClick("Uninstall Wizard", "No, I will restart my computer later.", "Button3") ControlClick("Uninstall Wizard", "No, I will restart my computer later.", "Button5") Exit EndIf Exit Now if I state that that window WILL show, it works just fine!!! Run("C:\Program Files\Hewlett-Packard\LaserJet 33xx\Uninstall\Setup.exe uninst.ini") WinWaitActive("Welcome", "&Next >") ControlClick("Welcome", "&Next >", "Button1") WinWaitActive("Uninstall Wizard", "File Name:") Send("!E") WinWaitActive("Uninstall Wizard Complete", "&Finish") ControlClick("Uninstall Wizard Complete", "&Finish", "Button1") WinWaitActive("Uninstall Wizard", "No, I will restart my computer later.") ControlClick("Uninstall Wizard", "No, I will restart my computer later.", "Button3") ControlClick("Uninstall Wizard", "No, I will restart my computer later.", "Button5") I am still a complete noob on this app but I am quickly learning the ropes. Can someone tell me what I am doing all wrong? thanks in advance... -redfive Share this post Link to post Share on other sites
bshoenhair 0 Posted March 28, 2005 (edited) Your not giving enough time for window "Uninstall Wizard", "File Name:" to show Try this: run("C:\Program Files\Hewlett-Packard\LaserJet 33xx\Uninstall\Setup.exe uninst.ini") WinWaitActive("Welcome", "&Next >") ControlClick("Welcome", "&Next >", "Button1") WinWaitActive("Uninstall Wizard", "File Name:",5);Give time for window to show If WinActive("Uninstall Wizard", "File Name:") Then Send("!E") WinWaitActive("Uninstall Wizard Complete", "&Finish") ControlClick("Uninstall Wizard Complete", "&Finish", "Button1") WinWaitActive("Uninstall Wizard", "No, I will restart my computer later.") ControlClick("Uninstall Wizard", "No, I will restart my computer later.", "Button3") ControlClick("Uninstall Wizard", "No, I will restart my computer later.", "Button5") Else WinWaitActive("Uninstall Wizard Complete", "&Finish") ControlClick("Uninstall Wizard Complete", "&Finish", "Button1") WinWaitActive("Uninstall Wizard", "No, I will restart my computer later.") ControlClick("Uninstall Wizard", "No, I will restart my computer later.", "Button3") ControlClick("Uninstall Wizard", "No, I will restart my computer later.", "Button5") Exit EndIf Edited March 28, 2005 by bshoenhair Share this post Link to post Share on other sites
redfive19 0 Posted March 28, 2005 You were right!!! I would have never thought of that. Mucho thanks! Share this post Link to post Share on other sites