CCleaner has a problem deleting folders

Last October, I reported a problem where CCleaner was not able to correctly empty the Recycle Bin if it contained one or more folders. In the discussion, I briefly touched on a possibly related problem where folders were not being deleted in %temp%, but never followed up on that specific aspect.

After some additional testing with the current release (both problems are still valid in 316.1666), it appears that for some reason the expected deletion of folders where applicable just isn't happening. For example, in my temp directory, I may have a dozen folders, some with subfolders, and there are files scattered in the top level, in the folders, and even in the subfolders. When I run CCleaner, all the files get deleted but... all the folders are left behind and remain as they were. I'd originally thought that the problem was something in the way the recycle bins on a dual disk system were being handled, but now believe it's a more global problem specifically related to folders since the recycle bin is also cleaned correctly - except for leaving behind any folder.

%temp% is in the default place, and it's being cleaned as expected - except for any folders. This problem started several releases ago (I don't remember the release where the problem began, but it's listed in the recycle bin problem discussion). Reverting to a prevous release runs as expected - also as described in the recycle bin problem.

XP, 32bit, SP3

Recently my v3.16 was bugged, among other issues it could not see any files in Recycle Bin, therefore could not remove them. I completely uninstalled CCleaner, searched my Win7 pc and removed all CC traces, reinstalled a fresh copy from filehippo. Now it works fine.

Try it. :)

You could also try the portable version and right-click "Run as Administrator" option (if you already haven't).

The previous topic mentioned above by RunAmok ...

http://forum.piriform.com/index.php?showtopic=34160&hl=&fromsearch=1

For the record, I've been trying each new release, then when it fails, reverting to the last working version (310.1525). I haven't tried the portable version. I'll see if I can find it, and will give that a try.

It's on this page

http://www.piriform.com/ccleaner/builds

I am also still running ver 3.10.1525 because of this problem. Waiting for confirmation that it has been fixed before upgrading.

Well... that's interesting. 317 portable works as expected - emptying the recycle bin containing a folder and deleting all the folders in %temp%, even though I'd just installed 317.1688 which still fails. The portable version may be ignoring something left over (and compatable with the old version) when I've been deleting the newest failing version, dropping back to the old version until a new version is announced, and then download and install the new version - which upgrades the old version. I'll do some digging and see if I can find any remnants left over after an uninstall.

The executables packed in the portable version are the same used in the installers.

The only different is that portable version doesn't use Windows Registry for settings, but ccleaner.ini.

We are trying to reproduce this issue, but haven't been successful. If we can't reproduce it is quite impossible to fix it.

Thanks

The previous topic mentioned above by RunAmok ...

http://forum.pirifor...l=&fromsearch=1

Dennis, it appears they had trouble actually finding the root cause & getting it to delete.

_____

I recently had that problem, & I had trouble myself deleting a file from the recycle bin, even after trying to delete the Recycler with Unlocker.

What worked for me, is to turn off system restore, then to set recycle bin size = 0 / OK / Delete hidden Recycler cache with Unlocker / Reboot / Run CCleaner / Reset to normal size.

Some of those steps may not have been totally necessary, but are included in case someone has problems.

_____

Example of why this is needed:

I was working on someone's computer with compromised permissions due an infected machine with TDSS rootkit installed. This also caused the normally protected C:\System Volume Information folder contents to be navigable.

While removing malware such as this, one of the A/V programs detected & removed several nasties from System Restore cache.

Recycle bin refused to let the file be deleted, & each subsequent "Delete with Unlocker" for the Recycle bin hidden folder would cause it to be recreated in the new Recycled cache with a new name.

Setting Recycle bin to 0 & shutting off System Restore while performing the steps above caused the problem to go away for me.

Additionally, I had to right-click the ini file necessary to reinstall System Restore in the Windows directory as System Restore service was malfunctioning and not working on this PC. Windows stated the restore service is on & working, but it wouldn't do a restore, so I had to re-install it to get it working & then I cleared the old restore points that no longer worked by right-clicking the C: drive \ properties \ doing a disk cleanup which included old restore points.

And this fixed the problems. I am sure this will help others who are experiencing the same. An undeletable file in the recycle bin can be made to go away, but they key is to set the recycle bin size to 0, & it may help to flush your System Restore cache if the file(s) being deleted happens to be from that area.

@SuperFast, it's not that anything in the recycle bin can't be deleted. Everything deletes as you'd expect using the Recycle Bin icon's 'Delete" link. The only problem is with CCleaner after release 310 (and is still happening in 318) which won't delete folders. I'd noticed that the latest release notes mentioned something about folders, but... it's still not deleting folders in either %temp% or in the recycle bin. Or, as I've just found, in places like C:\Documents and Settings\username\Local Settings\Temporary Internet Files\Content.IE5 which currently has over 40 folders - but no files in any of the folders now that I've run CCleaner. That's also true in Local Settings\History\History.IE5 (where Windows Explorer 'translates' what you see) but a DOS dir shows 8 directories dated back to the last time I ran 3.10. There's just something about folders on this system that CCleaner (beyond version 3.10) doesn't want to delete. There are, of course, some which are 'hidden', some 'read only', some both 'hidden' and 'read only', etc, but... most are just plan ordinary directories with no special attributes. In most cases, the high level folder (like %temp%, or recycler) needs to remain, but any folder under that should be deleted. And here at least, that's not happening.

As on old troubleshooter, I'm certainly aware that trying to find and fix a problem reported by the field is very difficult when you can't reproduce it locally. The first question I always tried to answer was "What changed?" There are usually a pot-load of possibilities, but I think we've narrowed down the possibilities - both here and In the original post describing problems deleting a folder in the recycle bin. The latest test described here http://forum.piriform.com/index.php?showtopic=34160&st=40, a should be another clue and might help.

To summarize that entry here, CCleaner releases from 3.11 through 3.18, downloaded and installed, fail to delete folders in my environment. 3.10 and the portable versions of the last two releases work as expected, and the .ini files for the failing version and the portable version of 3.18 were identical in the test. The recycle bin problem can easiy be overcome by simply emptying the recycle bin using the recycle bin "Empty". But for all the other places that folders need to be deleted, the solution is not nearly as obvious. For all those other places, there's simply no quick and easy way to get around what the installled versions of CCleaner isn't doing - beyond sticking with the portable version.

When using a version newer than 3.10 do you have the 24 hour rule unticked in Options->Advanced for the Recycle Bin.

I just wonder because of that old supposedly fixed Recycle Bin bug from several versions ago, and with all the "enhancements" in so many versions for cleaning the Recycle Bin as seen in the change logs all of which are available on FileHippo.com.

I tend to forget that some of the details in the original recycle bin post weren't duplicated here.... Yes, the 24 hour boxes are unticked for both the recycle bin and Windows temp folders.

I think I can explain why some folks have a problem removing folders from the recycle bin while others do not. If you simply delete 'normal' folders to the recycle bin, CCleaner deletes or erases them (depending on setting) just fine. However, now go to your User folder (name)\AppData\Roaming\Microsoft\Windows and COPY one of those folders, e.g. Start Menu, SendTo,etc. to a temporary folder. Now go to that temporary folder and delete that folder to the recycle bin. I believe you will find it will not delete from the recycle bin using CCleaner, probably due to some system attribute or similar issue. Hopefully this is a bug and not a system restriction that we have to live with. I've tried everything I know to get around it - unsuccessfully.

Those folders are only visible if you untick certain things like 'hide protected system files' etc.

I don't think ccleaner would be allowed to delete files such as these, they are protected by the system from 3rd party interference

What you say is true of system files when they are in their protected system folders. However, I first copied these folders to a temporary (unprotected) folder and then deleted them from there. Once they are in the recycle bin, they should be fair game for deleting or erasing, even if CCleaner has to modify one or more file or folder attributes to do so. As further proof, after copying one of these 'protected' folders to my temp folder, I am easily able to erase it from Explorer, bypassing the Recycle Bin. Since I can delete and erase it from there, it should be deletable from the Recycle Bin by CCleaner, just as I am able to go to the subfolder under Recycle Bin and delete it permanently. I really do believe this is either a bug or an oversight in the utility.

The devs read all posts so will see your thoughts on this Shodan.

Shodan, I'd guess that CCleaner is written to function by following the old "Above All, Do No Harm" directive. If it 'knows' that a folder can safely be deleted, like in the recycle bin or in other known and designated places like %temp%, for example, I expect it to clean up the junk. In other places however, it may not know for sure if a folder with special attributes is safe to delete or not (and it's not unlikely to find Windows or Application software creating such things in unexpected places). And there may be specific names which is 'knows' should be exempt, But I'd rather it took the safe path and bypassed the delete if there was any question.

Although everything else here seems to work as expected, there appears to be something unique in my system causing what I see here, so I can't test combinations of special attributes here since CC doesn't appear to delete any folders - whether or not they have special attributes like system, hidden, read only, or some other NTFS attribute I'm not aware of. The problem began with release 3.11, and has continued up through 3.19, but CC still works normally with version 3.10. It only fails with the normal downloaded package and works with the portable version - and version 3.10 or the portable version of the current release are options you might try. That difference between normal and portable suggests my problem is due to something in the registry , but... I haven't been able to find anything that looks suspicious other than two 'legacy' entries which are set to :"WIN95" even though I'm running XP SP3 32bit.

RunAmok, I tend to agree with your 'Above all, do not harm' theory, but feel it is inherent in the OS and not in file or folder attributes. Another thing, if I go to User folder (name)\AppData\Roaming\Microsoft\Windows and copy both the 'Recent' and the 'SentTo' folders to a temp folder and then delete them, when I run CCleaner it purges (erases, per my settings) the Recent folder, including files therein from my Recycle Bin AND will remove files within the SendTo folder, but will not remove the SendTo folder itself. Perhaps there is no way around this for CCleaner to defy the OS ? I tried searching the registry for ' $R1D7AGJ' which is the name of 'SendTo' once it hits the recycle bin, but no hits. That seems to leave either attributes that I am not aware of or the OS itself. As a side note, I am 95% certain I saw this same behavior with CCleaner waaaay back on my Windows 98 machine years ago. Also, I have always run the portable version, if that tells you anything.