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)
This will exclude all of the log files with the pattern *-*-*-*.* in the \system32\LogFiles\SCM\ folder of the user's Windows directory.
This will exclude the myfile.txt file located in the \system32\LogFiles folder of the user's Windows directory.
This will exclude the key located at HKCU\software\piriform (and any subentries)
This will exclude the files located in the C:\temp folder and all subfolders.
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.