I wrote a small utility called RunItOnce
to add a program to the Windows Registry RunOnce key. If you're not familiar with that key, how it works is a program is added to the key as a string value. On next boot, the program is run, and then Windows removes it from the registry.
It's good for tasks that won't work if Windows is fully engaged. One example is deleting all the index.dat files on the system partition.
Here's a link to RunItOnce page: Faves Downloads
Please see the included Readme.txt for usage details.
Also I'll post the index.dat cleaner code if you wish to use it. To run or compile the script you should first get and install AutoHotKey_L
Note that the AHK script will not work run normally since Windows doesn't like you deleting index.dat files once the system is up. It will work via the RunOnce key. That's why I wrote the RunItOnce program as it seemed like a simple utility to make this type of thing convenient.
I recommend you only run IndexDotDatCleaner on occasion. Maybe once a month. It will slow your boot down because it scans the entire system partition looking for index.dats and deleting them. That's why it's a good candidate for RunItOnce. You don't want to run it every boot.
Here's the AHK script
; IndexDotDatCleaner to delete all index.dat files on system
; partition. Should only be run via RunOnce key in Registry
; (See my RunItOnce program for a convenient way to add it.)
; It searches the entire partition for index.dat files. It will slow
; down the boot. It should only be used occasionally to clean them all out.
Edit: If you have a 64 bit system make sure to compile the AutoHotKey_L script above as a 64 bit application. Otherwise folder redirection will keep it from seeing and deleting the index.dat files that really store the data.
For help using AutoHotKey_L scripts and compiler look here: http://www.autohotkey.com/forum/topic34070.html