This article was submitted .

The CleanFiles is a Disk Cleanup Handler used with the Windows Disk Cleanup Utility available on Windows 98 and Windows 2000 and above. This nice utility can be run manually, but also pops up when you're running low on disk space.

If you're producing an application, which leaves temporary files that (for some strange reason) you don't clean up, you can create a handler to automate a clean-up job and integrate it into the Windows shell.
End-users seems happy about these kinds of integrations, though a .BAT file in most cases could have done the job.

The Source Code

Simple simple simple. Implements a COM object generated by the ATL class wizard, then implements IEmptyVolumeCache and IEmptyVolumeCache2 interfaces and tweaks the registry registration code.
Customize your own clean-up handler. Remember to change the GUID if you modify this sample.

Source Code Dependencies

Microsoft Visual C++ 6.0
Microsoft ATL Library

Download Files

DownloadSource Code (40 Kb)