Batch file to run CCleaner and exit

This is an extremely simple batch file that takes advantage of a built-in “command line switch” the developers of CCleaner have thoughtfully included.

If you look at the code below, you’ll see we’ve added “/AUTO” to the end of the command to start the program. This starts CCleaner, finds and deletes junk files, and exits the program.

Naturally, you’ll need to have CCleaner installed – click here for instructions

Code:

c:\progra~1\ccleaner\ccleaner /AUTO

Create a batch file to run CCleaner and exit

  • Double click My Computer, double click C: (Local Disk), right click, select New then Folder and type in “scripts” (without quotes).
  • Double click the scripts folder, right click, select New then Text Document and type in “ccleaner.bat” (without quotes). Windows will warn you about changing the file extension – click “Yes”.
  • Right click on ccleaner.bat, select Edit and Notepad will open with a blank page.
  • Copy and Paste or type in the code from above. Click File select Save, click File select Exit.
  • In your “scripts” folder double click on ccleaner and two things will happen fast; a black “DOS box” will pop up and the CCleaner icon will appear in your System Tray at the bottom right corner of your screen. They’ll both go away when CCleaner has finished running.

You’re done!

Similar Posts:

2 Responses to “Batch file to run CCleaner and exit”

  1. why does the command goes like this “progra~1” instead of “program files”.. i’m curious.. 🙂

  2. @hyper It’s an old habit. I use 8.3 style file & path names in batchfiles for the few programs that don’t understand Windows “long” names or can’t deal with spaces in directory or file names.

Leave a Reply