Internet Cache's index.dat Removal
Windows employs index.dat files for indexing the content of some folders (internet folders for the most part) to make subsequent accesses faster. As noticed earlier, cleanup with IE's Internet Options utility does not make full cleanup of the internet cache. In opposite to the empty content shown by Windows Explorer, the dir /s command shows that the Temporary Internet Files folder content is not actually empty, and contains the Content.IE5 folder (plus subfolders) and the index.dat file. This is because folders like Recent Documents, History, Temporary Internet Files, and some others are managed in Windows by Windows Shell, they are special folders.
Why bother about index.dat files at all? In fact, unhandled index.dat files represent a personal security breach. These files contain a list of all internet places visited, and can be viewed, copied etc. For example, suppose we don't want that private information about our favorite puppies (found out with IE on the internet) be recorded permanently on our computer. We empty the internet cache (i.e., remove physically cached web pages), but leave index.dat untouched. At first glance, our privacy has been protected. In contract to this conjecture, here is the screenshot of a typical index.dat viewer program output:
Indeed, index.dat provides an outlook of visited internet sites. Further, for the sake of experiment, you can try to copy an old index.dat onto a clean system, by replacing the existing index.dat, to see that the Temporary Internet Files folder is, in fact, a viewer of index.dat: no web content cached (internet browser has never been used), but the TIF folder shows many URLs (i.e., index.dat's content). Obviously, this is a loophole for malicious users who can copy the single file to see the browsing habits of a targeted person. Generally, there are three major index.dat files that keep a track of visited sites:
Internet Cache's index.dat located at %userprofile%\Local Settings\Temporary Internet Files\Content.IE5.
Internet History's index.dat located at %userprofile%\Local Settings\History\History.IE5.
Internet Cookies' index.dat located at %userprofile%\Cookies.
Because the deletion of any index.dat file goes in the same manner, I'd focus on the details on the subject of deleting cache's index.dat. Apparently, Win32's DeleteFile can be used to delete index.dat programmatically. Let's try, however, to delete index.dat manually with the equivalent del command. We'd see the infamous problem that index.dat cannot be deleted because: