#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=..\..\..\..\Program Files (x86)\AutoIt3\Icons\MyAutoIt3_Green.ico #AutoIt3Wrapper_Outfile=C:\Users\A\Desktop\CC.exe #AutoIt3Wrapper_Outfile_x64=..\CC.exe #AutoIt3Wrapper_UseX64=y #AutoIt3Wrapper_Add_Constants=n #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ; *** Start added by AutoIt3Wrapper *** #include ; *** End added by AutoIt3Wrapper *** ; C.Exe - AutoMaintenance Software. This program runs CCleaner. ; Close IE if it is running. ; Codes: 0=not running in C so don't restart in C.exe. Don't start it in Clean.exe either ; Codes: 1= running in C, shut off in C.exe. Not running clean.exe, so restart in c.exe ; Codes: 2= running clean.exe, but IE wasn't running. Don't run Chrome again. ; Codes: 3= running clean.exe, IE shut off in c.exe. Restart Chrome. ; Codes: 4= OFF.exe is running, don't run Chrome at all Dim $Cleanon="0", $IEon="0", $i="9", $OFFrunning="0" If ProcessExists("Off.exe") Then $OFFrunning="1" EndIf If ProcessExists("Clean.exe") Then $Cleanon="1" EndIf If ProcessExists("chrome.exe") Then $IEon="1" ProcessClose("chrome.exe") EndIf ; Set IE status here Select Case ($IEon = "0" And $Cleanon="0") IniWrite("C:\Users\A\Desktop\iecheck.ini","ON","key","0") Case ($Cleanon="0" And $IEon="1") IniWrite("C:\Users\A\Desktop\iecheck.ini","ON","key","1") Case ($Cleanon="1" And $IEon="0") IniWrite("C:\Users\A\Desktop\iecheck.ini","ON","key","2") Case ($Cleanon="1" And $IEon="1") IniWrite("C:\Users\A\Desktop\iecheck.ini","ON","key","3") Case ($OFFrunning="1") IniWrite("C:\Users\A\Desktop\iecheck.ini","ON","key","4") Case Else MsgBox(0, "", "No preceding case was true!") EndSelect ; Delete Certain files that take forever to clean. FileDelete("C:\Windows\Logs\CBS\*.*") FileDelete("C:\Users\Public\Recorded TV\TempRec\TempSBE\*.*") Sleep(2000) ; Wait ; ------------- Open CCleaner / Run ---------------------- Run("C:\Program Files\CCleaner\CCleaner.exe", "",@SW_MAXIMIZE) WinActivate("CCleaner") ; Activate Window WinWaitActive("CCleaner") Sleep(2000) ; Wait Send("!A") ; Analyze Sleep(2000) Do Sleep(200) WinActivate("CCleaner") WinWaitActive("CCleaner","") Until ControlCommand("CCleaner","","[CLASSNN:Button2; TEXT:&Analyze; ID:1020; INSTANCE:2]","IsEnabled","")=1 _ OR ControlCommand("CCleaner","","[CLASSNN:Button2; TEXT:Analyze; ID:1020; INSTANCE:2]","IsEnabled","")=1 Sleep(2000) If ControlCommand("CCleaner","","[ClassNN:Button3; Instance:3; ID:1021; TEXT:&Run Cleaner]","IsEnabled","")=1 Then Send("!R") Do Sleep(500) WinActivate("CCleaner") WinWaitActive("CCleaner","") Until ControlCommand("CCleaner","","&Run Cleaner","IsEnabled","")=1 EndIf ; SCAN REGISTRY ------------------------------------------------------- Sleep(3500) ; Wait Send("!g") ; Clean Registry Send("!S") ; Scan for Issues Sleep(1000) ; Wait (Cancel Scan enabled) While ControlCommand("CCleaner","","Scan for Issues","IsEnabled","")=0 And _ ControlCommand("CCleaner","","&Scan for Issues","IsEnabled","")=0 Sleep(100) WEnd Sleep(1500) ; Wait for Fix Selected Issues WinActivate("CCleaner") WinWaitActive("CCleaner","") If ControlCommand("CCleaner","","&Review selected Issues...","IsEnabled","")=1 Or _ ControlCommand("CCleaner","","&Review selected Issues...","IsEnabled","")=1 Then WinActivate("CCleaner") ; Activate Window WinWaitActive("CCleaner") Send("!R") ; DUH?? Sleep(2000) ; Wait for Child Window If ControlCommand("CCleaner","Fix All Selected Issues","Static6","IsEnabled","")=1 Then ControlClick("","Fix All Selected Issues",1104) ;~ Send("{RIGHT}") ; press right arrow ;~ Send("{RIGHT}") ; press right arrow ;~ Send("{ENTER}") ; press enter ;~ Sleep(2000) ; wait a sec or two ;~ Send("!{F4}") ; Close Child window EndIf If ControlCommand("CCleaner","Fix Issue","Static6","IsEnabled","")=1 Then ControlClick("","Fix Issue",1099) ; Send("{Enter}") ; Send("!{F4}") ; Close FixxBox EndIf EndIf Sleep(1000) ; Wait WinActivate("CCleaner") ; Activate Window WinWaitActive("CCleaner") Send("!{F4}") ; Close CCleaner $i=IniRead("C:\Users\A\Desktop\iecheck.ini","ON","key","Not Found") If $i="4" Then Exit EndIf If $i="1" Then ;Run("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe","",@SW_MAXIMIZE) EndIf Exit