Another instance when this sort of thing is required when using certain P2P programs, like Shareaza. Shareaza stores an XML file for every single download in the download location, which is set by the user. For example if the download location was set to "c:\folder\shareaza downloads\" then XML files for all previous downloads would be in "c:\folder\shareaza downloads\metadata\".
So, what is needed is a way to read the reg key to find out the download location, and then to delete the specified files from it.