How-To Geek

Setup CCleaner to Automatically Run Each Night in Windows 7, Vista or XP

After writing the article yesterday about how to run CCleaner silently through a shortcut or a hotkey, many people expressed to me that they’d like to know how to run it every single night on a schedule, so I’m writing that up for everybody’s benefit.

Setup Your Options

You’ll need to decide which settings you want to run when CCleaner is run automatically… for instance, I’d look at whether or not you want to clean out your cookies or recent documents (which is a feature I use often, so I don’t want them cleaned out)


Next, take a trip over to Options \ Advanced and make sure that the “Save all settings to INI file” option is checked (it should be checked by default). This makes sure that whatever settings you’ve chosen are saved out to an INI file in the same directory.


Create the Scheduled Task in Windows 7 or Vista

Open up Task Scheduler by typing it into the Start menu search box, or browsing to Accessories \ System Tools.

Once you are there, click the link for “Create Basic Task” on the right-hand side.


Give the task a memorable name like “Run CCleaner”


Choose “Daily” or “Weekly”, depending on how often you want the task to run.


Now choose a time of the day that your computer is usually on, but you aren’t using it.


On the next screen, choose to “Start a program” and go to the next screen.


Now you’ll need to browse down to the CCleaner executable file, which is typically found in the following location, but could be elsewhere:

C:\Program Files\CCleaner\CCleaner.exe

Make sure to add the /AUTO switch to the “Add arguments” box.


On the Summary screen, make sure to click the box for “Open the Properties dialog” before clicking on the Finish button.


Now you’ll want to choose the option for “Run with highest privileges”, so that the task will automatically run with administrator privileges.


Optional: You can also take a look at the Conditions tab, and choose the option to start the task only when the computer is idle for a certain amount of minutes.

You should notice the “Wake the computer to run this task” option as well… if you usually put your computer into Sleep mode, you can check that box so that the computer will wake up to run CCleaner.


You can test out the task by right-clicking on the item in the list, and choose Run. CCleaner should run silently in the background.


You can look around at some of the other options… for instance some people run CCleaner a couple times a day (although that seems a little excessive to me… once a week would probably be good enough)

Create the Scheduled Task in Windows XP

If you are using Windows XP, there is a whole different wizard you’ll have to go through… open up Scheduled Tasks in Control Panel or from the Start Menu’s Accessories \ System Tools section, and then click on “Add Scheduled Task”


If you’ve installed CCleaner using the regular installer, you should see it in the list. If not, then you’ll have to browse down to the location of the file.


Then you’ll want to give the task a helpful name, and choose “Daily” or “Weekly”, depending on how often you want to run it.


Now choose a time of the day that your computer will be on, but you won’t be using it, like 1AM (or if you are like me, 8AM)


You’ll be asked to enter the password for your user account.


Make sure to check the box for “Open advanced properties” and then click on the Finish button.


Now you’ll want to modify the Run command to include the /AUTO switch at the end. Make sure to put a space between.


If you look at the Settings tab, you’ll see the options to only start the task if the computer is idle, and also the same option to “Wake the computer to run this task”, which is useful if you usually put your computer into standby mode when you aren’t using it.


You can test out your scheduled task by right-clicking on it and choosing Run. CCleaner should open and run in the background.


Download CCleaner from (Download the Slim build which doesn’t bundle the Yahoo! toolbar)

Lowell Heddings, better known online as the How-To Geek, spends all his free time bringing you fresh geekery on a daily basis. You can follow him on if you'd like.

  • Published 07/25/08

Comments (30)

  1. InDiSent

    Sweet, thanks.

  2. USBman

    I’m still sticking with my comment from yesterday’s post; I think there is potential in using a separate, portable version for specific tasks. Say, for example, you followed these directions, but didn’t necessarily want CCleaner to ‘clean’ all the same things when you did NOT run it on the set schedule – rather than having to then switch these other features on or off everytime you ran it on it’s own, you can simply have a separate version, left untouched and waiting for your every command.

    …anyhow, just another option to add to this helpful tip!

  3. Rob

    I always use the options to set the cookies I want to keep then CCleaner only deletes the ones I don’t want.

  4. jsmorley

    One note. I think cleaning up cookies is an important part of what CCleaner does. I notice that you turn off this feature in your “automated” solution. I would make a suggestion. If you look at the “options” button on CCleaner, it has a place where you can tell it to ignore selected cookies when it runs, while allowing it to get rid of all the tracking cookies and other cookie crumbs that are installed when you surf around the net.

    What I did was to have CCleaner get rid of all cookies, then surfed around to my favorite web sites where I need to login. Log in to each, then go back to CCleaner and “exclude” the cookies which have been created by your favorite sites using “options / cookies”. Now you can run CCleaner with cookie cleanup turned back on in your automated task, and you get a better result.

    Thanks for the article. Good one.

  5. The Geek


    That’s a really good technique… I never thought of doing it that way. =)

  6. Steve

    I wish there was a setting that would automatically run cleaner prior to shutdown.


  7. Bruce

    Whenever I run CCleaner I get the following RUNDLL popups: Error in InetCpl.cpl Missing entry:Clearmytracksbyprocess

    It did not use to do this but I don’t know what might have been deleted to cause this to happen. Any thoughts?

  8. The Geek


    I’ve been looking into that, actually. The problem is that while you can assign a logoff script through group policy or an obscure registry hack, the process can only run with regular user credentials.

  9. W.

    I think it will be just great, if there was a way to run ccleaner autmatically each time i close my browser, there may be a program around there that would be able to do that…
    well, why may you do something if a program can do it for you?

  10. Chris

    Theres an option in ccleaner to run on startup why dont evry1 do that? Its quite quick too!

  11. abhishek

    thanks for the article,

  12. Rixster

    TWIMC: from the changelog of CCLeaner v2.10.618 (released today).
    – Added /SHUTDOWN command-line parameter to shutdown the computer
    after cleaning. Only works with /AUTO.

  13. Mark Foolot

    Whenever I run CCleaner I get the following RUNDLL popups: Error in InetCpl.cpl Missing entry:Clearmytracksbyprocess

    How do I fix this??

  14. Thomas

    If I setup this task with an admin account, will CCleaner clean all other Windows accounts, their temp files, cookies and so on ? If not, is thee a way to automate CCleaner to run every night and clean data for ALL Windows profiles ?

  15. grey

    great stuff

  16. Rick

    I am using Karen Kenworthy’s show stopper to automate a bunch of shutdown tasks to run Spybot, antivirus, ccleaner, jkdefrag and others. When all are done showstopper will suspend, hibernate or shut down your computer for you. I put a daily and a weekly button on desktops for different levels of cleaning actions.


  17. Poophatch_81

    What cookies are you trying to keep? I have CCleaner blast everything and Mozilla still retains my passwords. That’s all I need. I figure I might be missing out on something cool, or I’m doing something awesome and not realizing it.


    this solution only runs the application cleaning aspect of ccleaner … most people use it for its registry cleaning functions …. no one has yet to find an auto run command for that part of the program … that I’ve found anyways … =:o(

  19. rach

    This was the most insanely useful tutorial – thanks for setting it up so us folks without advanced tech know-how could still use it!

  20. Max

    I’d recommend running this task as NT AUTHORITY\SYSTEM, so that if you happen to be scheduling this as part of maintenance on someone else’s computer (which lacks a login password), there will be no errors having to do with incorrect credentials.

  21. Max

    Especially since Defraggler, one of Piriform’s other programs, uses that for the built in scheduler function anyway, which makes a scheduled task based on the options you select through their own wizard.

  22. maredferrari


    I was trying and trying to wake my 64-bit Windows 7 from sleep mode to play an alarm clock with 3rd party software when the task scheduler option was there all along!

    Many Thanks!

  23. E

    Does this do the registry cleaner too?

  24. Ajay


    I have been using Ccleaner since 4 years and found to be very helpful and fast.

    It clears the Registry also.


  25. Mike

    What does the /AUTO at the end of the run field do?

  26. sDwb

    /AUTO triggers the search & clean function, instead of only running the application.

  27. Kambic

    The CCleaner app is a good one but the functionality of automating it is even better. I have read through everyone’s methods of how they use it and thought I would share mine; I solely work in an environment of 319 actively networked computers. So you can imagine trying to go around to every one computer would be tedious. However, my process to get the right answer was also tedious but now it is smoothe flowing. Anything I can automate, the better! More time to read these forums:) Also, I try to limit how much and what software I install on my images. This creates a problem as CCleaner won’t run as a scheduled task with the portable version of CCleaner. At least i haven’t been able to get it to work without tweaking it. So I took WinRAR and compiled an SFX archive with the latest version of Portable CCleaner, the ccleaner.ini (Where I can set my exceptions like cookies to save and files to clean), the Lang folder, and the .dat file. Within the SFX options of WinRAR I can add the /AUTO argument which will allow it to run in the background and without interacting with the app thus automating the task. Once that is compiled (1.25mb), I took the new .exe and put it in a folder hidden from everyday users and created the task and I was good to go. It seems elaborate and maybe over complicated but the work and research has and will save me hours of work in the long run. PDQ Deploy is another route I am working with that may do the same thing. Again, if it can be automated, that’s just one less thing that will consume your day.

  28. Dawn

    Regarding removing cookies you don’t want, why not just let Firefox (if you are using it) do it for you?
    In Firefox go to Tools>Options>Privacy
    Then set it up to Accept cookies from sites PLUS 3rd party cookies.
    Then in the “Keep Until”, Choose “I close Firefox”.
    You can also set up in the “Exceptions” window cookies to allow and block.

  29. Chris

    Is it possible to make it do a registry scan?
    This would really help me get a weekly, anti-error schedule

  30. Cindy

    Thank you soooo much for the advice and steps to complete the task of ccleaner. I was worried that I might choose the wrong files in the ccleaner set-up for my profesoinal, windows xp. Can you advise a list of files I can deleate/clean without harm? Also, when I went to some of the files to see if clean-up took place I still saw many I believed should of been wiped clean. Second: I am getting an error on \Temp\werd227.dor00\oexplore.exe.mdmp and \Temp\werd277.dir00\appcompat.txt ? Do these messages signal the start-up warrining I get “Hard drive problem”? Your help would be greatly appreciated, Cindy

More Articles You Might Like

Enter Your Email Here to Get Access for Free:

Go check your email!