New Envrionment Variable

I'd like to propose the inclusion of a new envrionment variable: %Documents% or %Docs%

This would be useful because %UserProfile%\My Documents does not work in Windows 6.x+ and %UserProfile%\Documents does not work in 5.1-

Just a thought :)

This is a bit confusing.

You want this variable added to the Includes rules, or to CCleaner cleanup?

It would help if you told us where you wanted it added & why so we can understand your logic.

Thanks!

Neither, he is asking the developers to variablize documents in order to make cleaning locations that are in the documents folder cross Version compatible.

It is the same as when they added %locallowappdata% which does not exist in windows

+1 on that.

I was also hinting at probably including Windows? "special folders" (CSIDL_xxx, or nowadays KNOWNFOLDERID_xxx) in another post. There?s a bunch of them, and just sometimes it would come in very handy to be able to use them for cleansing (like in winapp2.ini).

Having those evaluated and available inside CCleaner would avoid having to hard-code things like "My Documents" and having to change these manually for different Windows versions and/or locales.

My suggestion would be these:

1. VARIABLES THAT MAKE SENSE WITH CCLEANER (ONE SHOULD USE THESE)

%CDBurning% (CSIDL_CDBURN_AREA, 0x3b)

%CommonFavorites% (CSIDL_COMMON_FAVORITES, 0x1f)

%CommonOEMLinks% (CSIDL_COMMON_OEM_LINKS, 0x3a)

%CommonStartup% (CSIDL_COMMON_STARTUP, 0x18)

%Cookies% (CSIDL_COOKIES, 0x21)

%DesktopDirectory% (CSIDL_DESKTOPDIRECTORY, 0x10)

%Favorites% (CSIDL_FAVORITES, 0x06)

%History% (CSIDL_HISTORY, 0x22)

%InternetCache% (CSIDL_INTERNET_CACHE, 0x20)

%LocalAppData% (CSIDL_LOCAL_APPDATA, 0x1c)

%Music% (CSIDL_MYMUSIC, 0x0d)

%Personal% (CSIDL_PERSONAL, 0x05)

%Pictures% (CSIDL_MYPICTURES, 0x27)

%Profile% (CSIDL_PROFILE, 0x28)

%ProgramData% (CSIDL_COMMON_APPDATA, 0x23)

%ProgramFiles% (CSIDL_PROGRAM_FILES, 0x26)

%ProgramFilesCommon% (CSIDL_PROGRAM_FILES_COMMON, 0x2b)

%ProgramFilesCommonX86% (CSIDL_PROGRAM_FILES_COMMONX86, 0x2c)

%ProgramFilesX86% (CSIDL_PROGRAM_FILESX86, 0x2a)

%PublicDesktop% (CSIDL_COMMON_DESKTOPDIRECTORY, 0x19)

%PublicDocuments% (CSIDL_COMMON_DOCUMENTS, 0x2e)

%PublicMusic% (CSIDL_COMMON_MUSIC, 0x35)

%PublicPictures% (CSIDL_COMMON_PICTURES, 0x36)

%PublicVideos% (CSIDL_COMMON_VIDEO, 0x37)

%Recent% (CSIDL_RECENT, 0x08)

%RoamingAppData% (CSIDL_APPDATA, 0x1a)

%Startup% (CSIDL_STARTUP, 0x07)

%System% (CSIDL_SYSTEM, 0x25)

%SystemX86% (CSIDL_SYSTEMX86, 0x29)

%Videos% (CSIDL_MYVIDEO, 0x0e)

%Windows% (CSIDL_WINDOWS, 0x24)

2. VARIABLES THAT CAN BE USEFUL FOR SPECIAL REQUIREMENTS

%AdminTools% (CSIDL_ADMINTOOLS, 0x30)

%AltStartup% (CSIDL_ALTSTARTUP, 0x1d, obsolete, use "Startup")

%CommonAdminTools% (CSIDL_COMMON_ADMINTOOLS, 0x2f)

%CommonAltStartup% (CSIDL_COMMON_ALTSTARTUP, 0x1e, obsolete, use "CommonStartup")

%CommonPrograms% (CSIDL_COMMON_PROGRAMS, 0x17)

%CommonStartMenu% (CSIDL_COMMON_STARTMENU, 0x16)

%CommonTemplates% (CSIDL_COMMON_TEMPLATES, 0x2d)

%Desktop% (CSIDL_DESKTOP, 0x00)

%Documents% (CSIDL_MYDOCUMENTS, 0x0c)

%Fonts% (CSIDL_FONTS, 0x14)

%LocalizedResourcesDir% (CSIDL_RESOURCES_LOCALIZED, 0x39)

%NetHood% (CSIDL_NETHOOD, 0x13)

%PrintHood% (CSIDL_PRINTHOOD, 0x1b)

%Programs% (CSIDL_PROGRAMS, 0x02)

%ResourceDir% (CSIDL_RESOURCES, 0x38)

%SendTo% (CSIDL_SENDTO, 0x09)

%StartMenu% (CSIDL_STARTMENU, 0x0b)

%Templates% (CSIDL_TEMPLATES, 0x15)

3. VARIABLES THAT ONLY RETURN CLSIDs (MIGHT NOT BE USEFUL WITH CCLEANER)

%ComputerFolder% (CSIDL_DRIVES, 0x11)

%ComputersNearMe% (CSIDL_COMPUTERSNEARME, 0x3d)

%ConnectionsFolder% (CSIDL_CONNECTIONS, 0x31)

%ControlPanelFolder% (CSIDL_CONTROLS, 0x03)

%InternetFolder% (CSIDL_INTERNET, 0x01)

%Network% (CSIDL_NETWORK, 0x12)

%PrintersFolder% (CSIDL_PRINTERS, 0x04)

%RecycleBinFolder% (CSIDL_BITBUCKET, 0x0a)

At least these are the ones I use. (And I hope the developers read these threads. The CSIDLs (KNOWNFOLDERIDs nowadays) are actually easy to obtain from almost all Windows versions since Windows 2000.) Hint: Use the functions but never the registry keys ? the latter aren?t supported, and anyway only set up after first use of a special folder.

The devs do read the threads, and I hope they take your post(s) into strong consideration :)

Cheers for the answer, Winapp2.ini!

Up to (and including) Vista, the above should be sufficient and give usable results. The same holds for Win7 (as far as CSIDL goes), but from a programming point of view, I?d use an OS version check, and if we?re on Vista (or above), use KNOWNFOLDERIDs in addition, to get all the extra ones not (yet) addressed by my stuff, like, for instance

LocalAppDataLow

PhotoAlbums

Ringtones

PublicRingtones

Games

GameTasks

RecordedTV

RecordedTVLibrary

SavedGames

SavedSearches

Just to mention a few right from the memory ?

The only remaining (and increasingly important) point to address would be how to prevent CCleaner from actually using paths with EMPTY substitution, i.e., using a variable in winapp2.ini that returns an empty result (say, %LocalLowAppData% on Windows XP). If those got used, like in

FileKey1=%LocalLowAppData%\MyApp\SomeStuff|*.*|RECURSE

CCleaner might otherwise inappropriately return a path of

\MyApp\SomeStuff\*.*

which could lead to all sorts of odd errors, of course.

Just imagine

FileKey1=%LocalLowAppData%|*.*|RECURSE

being "expanded" to

\*.*

Aaaaargh!

Then again, I assume the programmers do variable substitution in some part of CCleaner and would be able to detect an empty value. And probably just not allow this to happen (say, by ignoring the path in this case, not doing anything on it, and continue with the next FileKey, if any).

Oh well. 'Nuff said. B)