amin84 Posted August 27, 2010 Share 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 Link to comment Share on other sites More sharing options...
amin84 Posted August 27, 2010 Author Share 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 Link to comment Share on other sites More sharing options...
kbrower Posted June 13, 2012 Share 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. 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