Jump to content

WinReg1, SpecialKey


liviu

Recommended Posts

I have a couple of questions while trying to configure a portable (free) CCleaner so as to minimize the risk of cleaning unwanted entries on a different machine (and eliminate the need to carefully review the settings each time). Idea was to extract the embedded ini files (using /export), change default=true to default=false for most/all entries, then rename the files to *1.ini. But...

 

https://www.piriform.com/docs/ccleaner/advanced-usage/ccleaner-ini-files/what-do-ccleaners-ini-files-do does a good job explaining the INI overrides, however, it only mentions winapp and winsys. Are winreg1.ini and winreg2.ini supported at all, and do they work the same?

 

https://www.piriform.com/docs/ccleaner/advanced-usage/ccleaner-ini-files/how-to-add-other-areas-of-windows-for-ccleaner-to-clean has a note at the end...

 

 

If you examine the internal CCleaner INI files (available on the Piriform forum), you'll notice that certain operations in the winsys.ini file use the SpecialKey feature. This calls internal cleaning routines from the CCleaner executable. You cannot access SpecialKeys from a custom INI file.

 

...referring to winsys (there is no such note on the similar page about winapp). Does this mean that it's not possible to create a winsys1.ini which duplicates the embedded one, except it has everything unchecked by default?

 

Thanks,

Liviu

 

Link to comment
Share on other sites

  • Moderators

Winsys and winsys2 yes, winreg and 2 I believe so, but I never tried as I have no specific keys that would have issue nor how to unravel the specialkeys (which also exist at least in the detect key for browsers).

 

ADVICE FOR USING CCleaner'S REGISTRY INTEGRITY SECTION

DON'T JUST CLEAN EVERYTHING THAT'S CHECKED OFF.

Do your Registry Cleaning in small bits (at the very least Check-mark by Check-mark)

ALWAYS BACKUP THE ENTRY, YOU NEVER KNOW WHAT YOU'LL BREAK IF YOU DON'T.

Support at https://support.ccleaner.com/s/?language=en_US

Pro users file a PRIORITY SUPPORT via email support@ccleaner.com

Link to comment
Share on other sites

Thanks, though not sure I am parsing your reply correctly.

 

To rephrase my questions... What I am after is setting up a default config where nothing is "cleaned" by default, no matter what machine ccleaner is later run on. And, where manually enabling a "clean this" target would work just as if the option were never turned off.

 

( That can't be done via ccleaner.ini alone, since it only holds settings for the machine it is originally being set up on. But CCleaner has many of its 'clean' options enabled by default, and a different machine may well have programs installed which don't show up in the original ccleaner.ini, yet are enabled by default for cleaning in its internal winapp.ini/winsys.ini/etc. )

 

I thought I could work the "turn all off by default" part by having winapp1/winreg1/winsys1.ini files based on the embedded ones, with just default= changed to =false. But the official docs make no mention of "winreg1" (or winreg2, for that matter). Also, many of the builtin .ini entries make use of a SpecialKey1= entry that the other official doc says doesn't work in external .ini files - which, taken at face value, would mean that a custom winapp1.ini file could never truly duplicate the builtin "clean" action, even if the user later checked the option.

 

So, my question again, is the official documentation incomplete (about winreg1.ini) and wrong (about syskeys), or is it really not possible to force a clean-slate do-nothing base configuration?

 

Link to comment
Share on other sites

That won't work via the user interface, because it only shows - and lets me enable/disable - items that are installed on my machine at that point in time.

 

Suppose, for a simple/silly example, that I run CCleaner portable on my office machine where there is only Internet Explorer installed. I uncheck everything, and copy the files including my just customized CCleaner.ini to a flash drive. Later, I plug the stick into my home machine where I have Chrome and Firefox installed as well. And, surprise, those show up with a lot of options enabled - which I never did enable myself, nor had the chance to preemptively disable in advance.

 

In general, this hidden-yet-enabled-by-default behavior means that one can't know beforehands what exactly will be cleaned on a machine different than the one CCleaner was originally set up on, at least not without reviewing the options every time. This also severely limits the usefulness and transparency of /AUTO.

 

Link to comment
Share on other sites

That won't work via the user interface, because it only shows - and lets me enable/disable - items that are installed on my machine at that point in time.

 

Suppose, for a simple/silly example, that I run CCleaner portable on my office machine where there is only Internet Explorer installed. I uncheck everything, and copy the files including my just customized CCleaner.ini to a flash drive. Later, I plug the stick into my home machine where I have Chrome and Firefox installed as well. And, surprise, those show up with a lot of options enabled - which I never did enable myself, nor had the chance to preemptively disable in advance.

 

In general, this hidden-yet-enabled-by-default behavior means that one can't know beforehands what exactly will be cleaned on a machine different than the one CCleaner was originally set up on, at least not without reviewing the options every time. This also severely limits the usefulness and transparency of /AUTO.

 

Create a version of winapp1.ini and winsys1.ini where all of the DETECT/DETECTFILES = C:\ and all default=False

 

Open CCleaner, save settings to INI

 

First enable, then disable all rules.

 

You can then take the ccleaner.ini that is created as your seed for future settings.

 

This will port over to a "normal" CCleaner instance because the settings work by name (eg. WIPE FREE SPACE = TRUE is TRUE whether or not its your entry named WIPE FREE SPACE or Piriforms!)

Link to comment
Share on other sites

Neat! Thank you. (There are a few more variations like SpecialDetect/Detect#/DetectOS/etc to edit. And the lines in question can also be ";" commented out, or simply deleted.) But this way all options remain in ccleaner.ini, win*1.ini are not used, and therefore the SpecialKey1= worries become moot.

 

Liviu

 

P.S. FWIW here is a batch file to automate the process (must be run at an elevated cmd prompt in vista+).

:: ccleaner-nop.cmd  --  baseline ccleaner.ini with all options turned off

@echo off & setLocal disableDelayedExpansion & pushd "%~dp0"
if defined ProgramFiles(x86) (set "cc=ccleaner64") else (set "cc=ccleaner")
if not exist %cc%.exe >&2 echo *** error: '%cc%.exe' not found & exit/b 1

:: extract embedded win*.ini files (fails if win*1.ini present !?)
for %%v in (winapp1.ini winreg1.ini winsys1.ini) do (
  if exist "%%~v" (
    1>&2 echo *** deleting '%%~v' - press any key to continue, or ^^C to abort
    pause >nul & del "%%~v" ) )
start /wait "" %cc%.exe /export
for %%v in (winapp.ini winreg.ini winsys.ini) do (
  if not exist "%%~v" >&2 echo *** /export error: '%%~v' not found & exit/b 2 )

:: write ccleaner.ini stub, append [<apps>] except [global], cleanup win*.ini
(echo [Options])
(echo CookiesToSave=)
(echo RunICS=0)
(echo WipeFreeSpaceDrives=)
(echo WipeMFTFreeSpace=0)
(echo Monitoring=0)
for %%u in (winapp.ini winreg.ini winsys.ini) do (
  for /f "tokens=1* delims=[]" %%v in ('findstr /r /c:"^\[.*\]$" %%u') do (
    if "%%~w"=="" if /i not "%%~v"=="global" (echo ^(App^)%%v=False) )
  del "%%~u" )

exit/b 0  %= popd/endlocal done automatically =%

ccleaner-nop-502.txt is the result of "C:\etc>cCleaner-nop.cmd >ccleaner-nop-502.txt" (using the current CCleaner v5.02). The file can be copied as ccleaner.ini to the CCleaner directory, and gives a baseline configuration with everything turned off.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.