CCleaner Automation

Recommended Posts

feistcomputers 0

feistcomputers 0

I am trying to automate about 5 programs to basically click the buttons i would click. Should be pretty simple if you i knew more but just beginning and starting to get the hang of it. I hate to bug you all but been working on this for 3hrs , testing, searching for info. and i'm stuck. Here is my code.

#RequireAdminRun (@ScriptDir & '\CCleaner.exe'); Always use this, it does mapping using the window versus the the whole screen, because every computer can have diff. resolutions.; have to change it in the info getter too. options/coordmode/windowsAutoItSetOption ('MouseCoordMode', 0)

;Waits for our window to come upWinWait("Piriform CCleaner");When it see's it the windows gets activated right away.WinActivate("Piriform CCleaner");primary means left click mouse, secondary means to right click. coord for where button is from info from mouse tab on into tool. 1 means 1 click.MouseClick('primary', 727, 530, 1, 0)

; Close the temporary warning msgbox - Got this to work , snippet i found on forum so figured use same for chrome waring also. If WinWait('', 'Do not show me this message again', 4) Then WinActivate("", 'Do not show me this message again') ControlClick('', 'Do not show me this message again', 1, 'left', 1) EndIf ; Close the temporary chrome warning msgbox - comes up with closing program, it is set to button 1 just like first one, but can get past it now. If WinWait('', 'Do you want CCleaner to close Google Chrome', 4) Then WinActivate("", 'Do you want CCleaner to close Google Chrome') ControlClick('', 'Do you want CCleaner to close Google Chrome', 1, 'left', 1) EndIf

Sleep (300)WinWait("Piriform CCleaner")WinActivate("Piriform CCleaner")MouseClick('primary', 716, 521, 1, 0) so if chromes not open i get to here. it does the clean. now how to i get it to watch for the " run cleaner button" to be active again and not greyed out. Once this shows active i can move on to next step but cant find much info on it. tried looking for ifenabled. I do alot of scans for virus infections. and waiting is part of the game for me. If i can get these to work that means less work and more time with my kids. GOAL any help appreciated. i watched tut.orial 9 & 10. Can you recommend any others for basic push buttons and wait secnario. Thanks for any help.

Share this post

Link to post

Share on other sites

feistcomputers 0

feistcomputers 0

Thankyou ComputerGroove, that just solved two my issues. Just one to go. I can put 5min wait timer on here if i have to do it. But i would rather have autoit see that button become ungreyed out and move onto the next step. Can anyone please point me in the right direction.

thanks for the help.

Share this post

Link to post

Share on other sites

VenusProject2 2

VenusProject2 2

Just a quick heads up on posting code, please use the add code icon"<>" in the toobar, e.g. your script:

#RequireAdminRun(@ScriptDir&'\CCleaner.exe'); Always use this, it does mapping using the window versus the the whole screen, because every computer can have diff. resolutions.; have to change it in the info getter too. options/coordmode/windowsAutoItSetOption('MouseCoordMode',0);Waits for our window to come upWinWait("Piriform CCleaner");When it see's it the windows gets activated right away.WinActivate("Piriform CCleaner");primary means left click mouse, secondary means to right click. coord for where button is from info from mouse tab on into tool. 1 means 1 click.MouseClick('primary',727,530,1,0); Close the temporary warning msgbox - Got this to work , snippet i found on forum so figured use same for chrome waring also. IfWinWait('','Do not show me this message again',4)ThenWinActivate("",'Do not show me this message again')ControlClick('','Do not show me this message again',1,'left',1)EndIf; Close the temporary chrome warning msgbox - comes up with closing program, it is set to button 1 just like first one, but can get past it now. IfWinWait('','Do you want CCleaner to close Google Chrome',4)ThenWinActivate("",'Do you want CCleaner to close Google Chrome')ControlClick('','Do you want CCleaner to close Google Chrome',1,'left',1)EndIfSleep(300)WinWait("Piriform CCleaner")WinActivate("Piriform CCleaner")MouseClick('primary',716,521,1,0)