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)
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.