How to Exclude Items from CCleaners Cleaning

Through the user interface, CCleaner users can choose to exclude files, folders, and Registry keys from cleaning.

Similarly, you can exclude files, folders, and Registry keys using entries in the INI when operating CCleaner programmatically, using the ExcludeKey command.

The ExcludeKey string has the following format in INI files:

ExcludeKeyX = [TYPE]|[PATH]|[FILENAME or REGISTRY KEY or FILETYPE or FILETYPES](Note the "|" in between)

  • X is a positive whole number. You can add as many entries as you need as long as the numbers don't repeat (for example, ExcludeKey1, ExcludeKey2, and so on).
  • The TYPE must either be PATH (to exclude folders), FILE (to exclude specific files), or REG (to exclude Registry entries).
  • You must either specify the PATH, PATH and FILENAME, or REGISTRY KEY, depending on which type of content you want to exclude.
  • You can only use the FILE switch to exclude a single file. To exclude multiple files of the same type, use the PATH switch and specify an extension (for example, *.txt). To exclude multiple files of different types, use a different ExcludeKey entry for each file.

Example 1:

ExcludeKey1=PATH|%windir%\system32\LogFiles\SCM\|*-*-*-*.*

This will exclude all of the log files with the pattern *-*-*-*.* in the \system32\LogFiles\SCM\ folder of the user's Windows directory.

Example 2:

ExcludeKey2=FILE|%windir%\system32\LogFiles\|myfile.txt

This will exclude the myfile.txt file located in the \system32\LogFiles folder of the user's Windows directory.

Example 3:

ExcludeKey3=REG|HKCU\software\piriform

This will exclude the key located at HKCU\software\piriform (and any subentries)

Example 4:

ExcludeKey4=PATH|C:\temp\|*.*

This will exclude the files located in the C:\temp folder and all subfolders.

Example 5:

ExcludeKey5=PATH|C:\Windows\|*.exe;*.bat

This will exclude files of types .exe and .bat in the C:\Windows folder.

Note: ExcludeX (not ExcludeKeyX) is a variable CCleaner uses to represent user settings on the Exclude pane in the Options section. ExcludeX will appear in ccleaner.ini when you set it to save settings in that INI file. Do not modify references to ExcludeX or IncludeX.

Need more information? Talk to our Business Team

×