Jump to content
CCleaner Community Forums
RunAmok

CCleaner has a problem deleting folders

Recommended Posts

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

when I run CCleaner it purges (erases, per my settings)

Do you "Secure Erase" or "Normal Delete".

This can make a difference.

Share this post


Link to post
Share on other sites

I ran a test using a handful of free cleaning tools and none of them including those that promise to delete files on reboot and also including CCleaner will delete a folder with the following attributes:

* Read-only

* System

 

Removing those attributes allows the folder to be deleted.

 

So possibly all of the cleaning tools I tried are smart enough to leave such folders alone as a safety precaution which would be wise if someone included something in the OS folder to clean, and/or Windows won't let them delete such folders - I don't know which that would be though.

Share this post


Link to post
Share on other sites

Alan_B - I've tried it both ways. No difference. The folder remains in my $Recycle.Bin

 

Andavari - Try for yourself. Go to your Users\(Name)\AppData\Roaming\Microsoft\Windows and copy the SendTo folder to a temp folder somewhere. This is just an example - other folders including the start menu exhibit the same behavior. Now go to that temp folder and you will see there are no System, Read Only or Hidden attributes set. Now simply delete this folder to the recycle bin, hopefully with your 'SendTo' shortcuts still in it. Now run CCleaner and you will see that the shortcuts that were in the folder are gone (either deleted or erased, depending on setting) but the folder itself (renamed $******) remains and the only way to get rid of it is with a right-click and delete in Windows Explorer.

 

For what it's worth, if I ERASE this file with an erase utility (and not delete it to the recycle bin,) I have no problem whatsoever, so it almost seems to be the Recycle.Bin location that appears to be protecting it, and others...

 

Hope this answers both questions.

Share this post


Link to post
Share on other sites

OK, after some testing, I can confirm that CC version 3.10 will delete a folder that's marked as read only (but see test results below) and any release from 3.11 on will not. I could buy that. Kinda. It does strke me as a shotgun approach to fix some specific problem where CC deleted some special folder which caused a problem though. CC doesn't seem to care about read only files, but it sure does care about read only folders. And I can't explain why the portable version doesn't care if a folder is set to read only and works as expected, but the normal install does care and won't delete them. Nor can I explain why, on this XP Pro x32 SP3 system ALL folders show as read only when I check the properties using Windows Explorer (and can't be reset) but the same folders do NOT show as read only when checked from a cmd/DOS window.

 

Viewing properties on a newly created test folder on the desktop (or any folder anywhere else for that matter) from Windows Explorer, the read only check box is totally green. I can click on it (it's then empty), click on Apply (it stays empty), but if I move to somewhere else and come back to check properties again, it's all green again. If, while I'm still looking at a folder's properties from Windows Explorer, I click on the read only box again when it's empty, I get a green check mark. And if I click Apply, I then see that it really is marked as read only when tested from a cmd/DOS window. But again, if I go somewhere else and come back to check properties from Windows Explorer, the read only box is all green again. And that's true even if I've reset the RO attribute from the cmd/DOS window.

 

For some reason, even though I can see that a folder does NOT have the read only attribute set (from a cmd/DOS test), there's something here that CC - and Windows Explorer - still sees and handles as if read only was set. Add one more entry in the Windows Wierdness list... Sometimes Windows makes my head hurt.... But at least I know now what changed in CC between 3.10 and 3.11, and why I started this chain with the symptoms I see on this system.

Share this post


Link to post
Share on other sites

If, while I'm still looking at a folder's properties from Windows Explorer, I click on the read only box again when it's empty, I get a green check mark. And if I click Apply, I then see that it really is marked as read only when tested from a cmd/DOS window. But again, if I go somewhere else and come back to check properties from Windows Explorer, the read only box is all green again. And that's true even if I've reset the RO attribute from the cmd/DOS window.

My experience with XP was that DIR under CMD.EXE would tell the truth as it is,

whilst Windows Explorer would say what it could remember from the past.

 

DIR would show the contents of a folder with the "last accessed" date correctly shown for each file,

and it did NOT modify the "last Accessed" date whilst it did so.

W.E. would show the same information for the same folder, BUT although it gave no indication it had done so, it "accessed" each file on display.

DIR would show the change to Last Accessed on the files that W.E. had looked at, but W.E. persisted with how they used to be.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...