Forum Home
Press F1
 
Thread ID: 39746 2003-11-16 02:59:00 XP TIP: Delete index.dat(s) Terry Porritt (14) Press F1
Post ID Timestamp Content User
192376 2003-11-16 02:59:00 The delete command in Windows XP has more useful switches than in dos6.22 and dos7.

So if you tend to paranoia and wish to delete the various index.dat files, it can be done from the Registry as Windows is being loaded. That way you dont get the message that the files arent accessible because they are in use as you would get if you tried to delete them with XP running.

Make a batch file with this line in it:
del /s /q C:\Documents and Settings\index.dat

and call it delindex.bat or whatever you like, and put it in C:\.

Open Regedit and navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Curr entVersion\Run

Make a new String Value, name it delindex, and then via right click Modify, give it the value:

%ComSpec% /c c:\zapindex.bat

The %ComSpec% command calls up a new instance of cmd.exe, and all the index.dat in Documents and Settings and its sub-folders will be deleted.
When Windows starts new index.dats will be made as neccessary but will be minimum size.

This is similar to deleting the index.dat in Win 98 from dos, but in this case a separate boot to dos is not neccessary.

To see the switches available just type del /? and %ComSpec% /? from the command line prompt.

Any comments gladly received :)
Terry Porritt (14)
192377 2003-11-16 04:37:00 Argh it didn't work for me. All index.dat file sizes remained the same. :-(

Am I doing the batch file thing wrong? All I did was paste the line

del /s /q C:\Documents and Settings\index.dat

into notepad and saved it as delindex.bat

More advice would be appreciated. :-)
Fire-and-Ice (3910)
192378 2003-11-16 06:14:00 %ComSpec% seems to just run cmd.exe. You _should_ be able to not use the batch file at all. By running cmd /c the c switch is used to "/C Carries out the command specified by string and then terminates". So you could just have the contents of the batch file after the "/c" and it should still execute correctly.

Another handy thing I've found for XP is that if you use a hosts file and find yourself having to enable/disable it a bit. A shortcut with the code: %windir%\System32\cmd.exe /c if exist %windir%\system32\drivers\etc\hosts (ren %windir%\system32\drivers\etc\hosts hosts.disabled) else (ren %windir%\system32\drivers\etc\hosts.disabled hosts)

works quite well as a toggle switch.
-=JM=- (16)
192379 2003-11-16 06:51:00 Wasn't NT based MS Windows meant to make the command line redundent? mark.p (383)
192380 2003-11-16 07:18:00 Thanks for the comments all.
Fire&Ice: If all is ok then your(Cookie) index.dat file may already be small. The file seems to increase in increments of 16KB, with a minimum size of 16KB.
Mine was 48KB, and after applying the batch file it fell to 32KB with a small handful of permanent cookies I keep such as PressF1, Live365, and a few other forums and favorite site cookies.

I turned off Cookie Crusher and set Privacy in IE to accept all cookies and browsed a bit to collect about another dozen maybe, but the index.dat was still at 32KB.

Just pasting that command line into notepad should be ok. Perhaps a carriage return at the end of the line is in order, or is that for making a .reg file? My brains cells are only short term :)

JM. Interesting. I found I needed the %ComSpec% in the Registry Key to call up a separate instance of cmd.exe, otherwise I was getting an error message to say the index.dat were not accessible and were in use, just as the Desktop was coming up when windows was loading.

I do the same as you with a hosts toggle, but being simple minded I made 2 batch files one for hosts on, one for hosts off.
I found I needed to do this for Live 365 streaming audio stations if I wanted to register a station as a favorite, ( the station author gets a discount if you do this). There was something in my hosts file preventing a drop down box working to set a favorite, and their help desk didnt know.

This is one of the toggles:

@echo off
c:
cd\windows\system32\drivers\etc
if exist hosts ren hosts hosts.off
cls
:end


The other says:

@echo off
c:
cd\windows\system32\drivers\etc
if not exist hosts ren hosts.off hosts
cls
:end

Then I have 2 shortcuts to the batch files, crude but it works.

Mark.p:
No Mark, in fact there seems to be more useful command line commands in XP with useful switches than in dos 7. Im only just starting to explore them. Deleting index.dat was my first stab at this in XP.

In dos there were just 2 switches for del, in XP there are 5.
Terry Porritt (14)
192381 2003-11-16 07:48:00 >
> Mark.p:
> No Mark, in fact there seems to be more useful
> command line commands in XP with useful switches than
> in dos 7. Im only just starting to explore them.
> Deleting index.dat was my first stab at this in XP.
>
> In dos there were just 2 switches for del, in XP
> there are 5.

Maybe I should have put [sarcasm] before the post.
mark.p (383)
192382 2003-11-16 07:58:00 Oh dear, I must be too serious tonight to take the hint :) Yes ok, it is just dos more or less, by another name.

MS did try from Win95 on to pretend dos wasnt there.
Terry Porritt (14)
192383 2003-11-16 08:09:00 ;) Here's MS's XP Command ref page-www.microsoft.com mark.p (383)
192384 2003-11-16 08:22:00 None of the index.dat files decreased in size. One of them is 2448KB in the C:\Documents and Settings\username\Local Settings\Temporary Internet Files\Content.IE5 folder and the next largest index.dat is C:\Documents and Settings\username\Local Settings\History\History.IE5 at 416KB. Both are in the same user account which has actually been removed so goodness knows why it is still in Win Explorer.

All the other index.dat files range from 16KB to 48KB but haven't been recreated since trying that batch file so it couldn't of worked.

Incidentally a cleaning program (can't remember which one) couldn't of cleared the index.dat files in the old user account either because it was deleted a long time ago. Rather interesting really. ;-)
Fire-and-Ice (3910)
192385 2003-11-16 08:55:00 Well, I cant give an answer. Just to check again I rebooted after reading your post, and all my index.dat immediately after re-booting doing anything else have a Date Modified 11/16/2003 at 9:39pm, and maximum size is 32KB

Re-check your entry in the registry, this is a .reg file for putting the line in the registry:

REGEDIT4

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Curr entVersion\Run]
"delindex"="%ComSpec% /c c:\\delindex.bat"

Instead of .bat you can use .cmd, then interesting the file type changes from ms-dos batch file to cmd file
Terry Porritt (14)
1 2 3 4 5