amin84 2 Posted August 27, 2010 (edited) Hi, I wrote the code below to reset internet explorer: ;IE Reset Automation RunWait("control.exe inetcpl.cpl,,6") WinWaitActive("Internet Properties") Send("!s") WinWaitActive("Reset Internet Explorer Settings") Send("!r") WinWaitActive("Reset Internet Explorer Settings") ;<---- Problem!!! Send("!c") ;Disable IE Popup RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "IE8RunOnceLastShown", "REG_DWORD", "00000001") RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "IE8RunOncePerInstallCompleted", "REG_DWORD", "00000001") RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "IE8RunOnceCompletionTime", "REG_DWORD", "0x") RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "IE8TourShown", "REG_DWORD", "00000001") RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "IE8TourShownTime", "REG_DWORD", "0x") RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "IE8RunOnceLastShown_TIMESTAMP", "REG_DWORD", "0x") ;Google homepage RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "Start Page", "REG_SZ", "http://www.google.ca/") RegDelete("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "Secondary Start Pages") Here is the problem. After we send Alt + R to reset, a small window will popup that will do some check marks and the close button is disabled until everything is done. Now sometimes this process will be done instantly, sometimes it will take 1 second to 12 seconds. Is there a way to pause the script and check if Close button is enabled and then press Alt + C to close it? Edited August 27, 2010 by leomoon Share this post Link to post Share on other sites
amin84 2 Posted August 27, 2010 After an hour of searching I found it. The script below will reset Internet Explorer Version 8. _qtIeReset() Func _qtIeReset() ;IE Reset Automation RunWait('control.exe inetcpl.cpl,,6') WinWaitActive('Internet Properties') Send('!s') WinWaitActive('Reset Internet Explorer Settings') Send('!r') WinWait('Reset Internet Explorer Settings') While Not ControlCommand('Reset Internet Explorer Settings','', 'Button1','IsEnabled','') Sleep(500) WEnd Send('!c') ;Disable IE Popup RegWrite('HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main', 'IE8RunOnceLastShown', 'REG_DWORD', '00000001') RegWrite('HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main', 'IE8RunOncePerInstallCompleted', 'REG_DWORD', '00000001') RegWrite('HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main', 'IE8RunOnceCompletionTime', 'REG_DWORD', '0x') RegWrite('HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main', 'IE8TourShown', 'REG_DWORD', '00000001') RegWrite('HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main', 'IE8TourShownTime', 'REG_DWORD', '0x') RegWrite('HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main', 'IE8RunOnceLastShown_TIMESTAMP', 'REG_DWORD', '0x') ;Google homepage RegWrite('HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main', 'Start Page', 'REG_SZ', 'http://www.google.ca/') RegDelete('HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main', 'Secondary Start Pages') Exit EndFunc Share this post Link to post Share on other sites
kbrower 0 Posted June 13, 2012 Although this thread is very old, I had to make an account to say thanks for this script. I needed to reset my IE settings and afterwards edit some registry values and this script was a very helpful reference. Share this post Link to post Share on other sites