Sign in to follow this  
Followers 0
Rogue5099

Reset Internet Explorer Automatically

6 posts in this topic

Tools ->Internet Options -> Advanced Tab -> Reset -> Reset -> Close

inetcpl.cpl gets you to Options faster.

ShellExecute("inetcpl.cpl")
WinWait("Internet Properties")
ControlClick("Internet Properties", "", 12320, "left", 1, 357, 10)
Sleep(500)
ControlClick("Internet Properties", "", 6010, "left", 1, 44, 10)
Sleep(500)
ControlClick("Reset Internet Explorer Settings", "", 1, "left", 1, 51, 12)

One problem is some computers are slower than others after doing controlclick and then it just does nothing. Also cleaning up at the end is unpredictable amount of time before clicking "Close"

Is there a faster way of doing this without using control clicks?

Share this post


Link to post
Share on other sites



RunWait ( 'rundll32.exe inetcpl.cpl ResetIEtoDefaults', '', @SW_HIDE )

Try to find the quiet switch ;)


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

I don't want it to be silent as I want the user to see it resetting (actually doing something). Adding it into a little "info utility" script easy enough for non-computer savvy users will get this script on their desktop after I repair their computer. Includes quick fixes, shortcuts, and computer information tools.

This seems to work well enough:

Run("rundll32.exe inetcpl.cpl ResetIEtoDefaults")
WinWait("Reset Internet Explorer Settings")
ControlClick("Reset Internet Explorer Settings", "", 1, "left", 1, 51, 12)
WinWait("Reset Internet Explorer Settings", "&Close")
Sleep(1000)
While WinExists("Reset Internet Explorer Settings", "&Close")
     ControlClick("Reset Internet Explorer Settings", "", 6608, "left", 1, 36, 11)
WEnd

Share this post


Link to post
Share on other sites

Ok rogue5099, but by curiosity i have searched a way to get a quiet command for reset IE Settings :

#Include <WinAPIEx.au3>

$_Pid = Run ( 'rundll32.exe inetcpl.cpl ResetIEtoDefaults' )
_WindowClick ( $_Pid )
ProcessWait ( 'rundll32.exe' )
Do
    $_ProcessList = ProcessList ( 'rundll32.exe' )
    If Not @error And IsArray ( $_ProcessList ) Then
    For $_I = 1 To UBound ( $_ProcessList ) -1
        If $_ProcessList[$_I][1] <> $_Pid Then ConsoleWrite ( '+->-- ' & $_I & " : " & _WinAPI_GetProcessCommandLine ( $_ProcessList[$_I][1] ) & @Crlf )
    Next
EndIf
$_ProcessList = 0
Until UBound ( $_ProcessList ) < 3
_WindowClick ( ProcessExists ( 'rundll32.exe' ) )
Exit

Func _WindowClick ( $_Pid )
    ProcessWait ( $_Pid )
    Local $_Hwnd, $_Data = _WinAPI_EnumProcessWindows ( $_Pid )
    If Not @error And IsArray ( $_Data ) Then $_Hwnd = $_Data[1][0]
    WinWait ( $_Hwnd, 3 )
    ControlCommand ( $_Hwnd, '', 'Button1', 'Check' )
EndFunc ;==> _WindowClick ( )

and it return C:\Windows\System32\inetcpl.cpl,ClearMyTracksByProcess 1023

So, quiet command to Reset IE to default Settings is : Run ( 'rundll32.exe inetcpl.cpl,ClearMyTracksByProcess 1023' ) ;)

where 1023 is the addition of different values that i can't determine...


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Following clears history and cookies:

RunWait("RunDll32.exe inetcpl.cpl,ClearMyTracksByProcess 3")

3 = 1+2 , 1 = History, 2 = Cookies, 3 = Both

I don't know the 1020 either.

Found these Google searching:

RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 1
Delete History

RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2
Delete Cookies

RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8
Delete Temporary Internet Files

RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 16
Delete Form Data

RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 32
Delete Passwords

RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255
Delete All

RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 4351
Delete All + files & settings stored by Addons.

Edit: Found on Google search!

Edited by rogue5099

Share this post


Link to post
Share on other sites

I know this values, but i didn't find any documentation for get 1023.

Microsoft is stingy with details on it... ;)


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0