Home   
 Bookmarklets
       WinClean  
    Alexa    
    Google    Google-Cookie
    KaZaA    
    Tools    
    Links    
        
Milly's WinClean
www.iMilly.com
 
An easy way to delete any or all of :-
  • IE Temporary Internet Files 
  • IE History
  • Cookies folder
  • Temporary Files folder
  • Recent Documents MRU list
  • Any others, if you add them yourself

 

 

Contents ...

 

What's the fuss about deleting Internet Explorer cache files, then?

Because each 'logged on' user profile gets their own Temporary Internet Files ("TIF") and associated stuff, Windows does its best to limit access to 'proper' means, by 'locking' those files soon after startup. You can clear the TIF cache (and the History and Cookies) from within IE (using the menu Tools/Internet Options/General), and that is the easiest way for most people in most circumstances.

But that way won't delete the the Index.dat files, which will contain functionally redundant, but potentially revealing, remnants of prior browsing. Depending on who has (or might gain) local or remote-controlled access to your PC, that may or may not have privacy implications for you. Moreover, the Index.dat files simply grow and grow forever - starting off at about 32kb, but potentially growing to many MBs. For some, that wasted space may be an issue. Nor will that way delete 'orphaned' files, which were downloaded to the cache but have been lost by the indexing system (because the system is broken, and always has been). Again, for some, the mere existence of such files may be a privacy issue, and may be a disk space issue.

So Milly's WinClean is mainly for fully deleting (though not secure wiping) the TIF - and any other stuff you wish, too (especially, but not limited to, files 'locked' by Windows during normal use).

But there's nothing fishy going on by Microsoft or anyone else, no matter what FUD you may have read :)

What's different from all the other batch files.

It just takes one double-click from within Windows. 

Then next time you reboot (and only the next time, until you choose to run it again) all that stuff will get deleted. You don't need to have an Autoexec.bat file, nor muck about with the Registry.  And because it runs under Windows it uses Windows' memory management too, even with Win9x, without needing to set a temporary SmartDrive cache in DOS.

System Requirements.
There are two versions. One works with Windows 9x (and maybe Windows ME). The other with Windows XP (but usually not Windows NT/2000).

If it doesn't work for you under ME, or you use NT/2K - but you need something similar for those OS's, you should check out Eric Howes' comprehensive tools and explanations (hey, you should do that anyway - you're guaranteed to find much there of interest), or the tools and links detailed at the bottom of this page.

Download Instructions ...

Win9x (or ME)

Right-click and save this ...  WinClean.bat  ... then move it to your root drive (e.g. c:\ or somewhere in your Path. You'll need to edit the location in WinClean.pif  if you put it somewhere other than c:\ , or just right-click on WinClean.bat once you've put it where you want, and drag/drop/"create shortcut here" to do it automatically. A .pif is just a shortcut to the .bat file)
 
Right-click and save this ...  WinClean.pif  ... then move it to wherever you'd like to click it (Desktop, Start Menu, TaskBar Toolbar, IE Links etc.)
 

XP

Right-click and save this ...  WinClean.cmd  ... then move it to your root drive (e.g. c:\ or somewhere in your Path. You'll need to edit the location in WinClean.lnk  if you put it somewhere other than c:\ , or just right-click on WinClean.bat  once you've put it where you want, and drag/drop/"create shortcut here" to do it automatically. A .lnk is just a shortcut to the .cmd file)

Right-click and save this ...  WinClean.lnk  ... then move it to wherever you'd like to click it (Desktop, Start Menu, TaskBar Toolbar, IE Links etc.)

Or for all four and a copy of this web page , right-click and save this ...  WinClean.zip

How to use...
Just double-click the WinClean shortcut (i.e. WinClean.pif for Win9x or WinClean.lnk for XP).  That's it!

(Tip - try doing that twice in a row to see what happens ... )

How it works ...

Win9x (or ME)

When you double-click the WinClean shortcut it will create a Winstart.bat file in your c:\ drive, which Windows will automatically execute next time Windows itself starts - thus deleting the folders listed, using the Deltree command.  Then Winstart.bat  deletes itself, so it won't run on next reboot (if you're quick you might see a DOS window - don't worry, that's the plan).
 
Winstart.bat is occasionally used by program installations (and Trojans!), so WinClean will abort itself if it finds one already there. And it will open the contents of the existing file in a Notepad window (together with an explanatory message).  If it all looks okay, you can just delete the explanatory message text and save the file (or just close it if you're busy or lazy), and carry on letting whatever else is using Winstart.bat do its stuff.  (It's probably not a good idea to clean the Temp folder during an unfinished program installation anyway - so aborting the cleanup is an intentional, if very modest, safeguard.)
 
Of course, if something else tries to create or add to Winstart.bat after WinClean, what happens depends on how the other program handles it.  So you may want to use this just before you shutdown or reboot.
WinClean.bat assumes these locations  :-
Root drive :
c:\
Recent documents :
c:\windows\recent
Temporary Files Folder :
c:\windows\temp
Cookies Folder :
c:\windows\cookies
IE History :
c:\windows\history
IE Temporary Internet Files :  
c:\windows\temporary internet files
You MUST edit them in Notepad if yours are different. And of course you can delete any you don't want to include, and add any that you do.
Remember, if you delete the index.dat files you will also lose any saved 'offline content'.  If that's not what you want, you need to stick with IE's own system, or use a more comprehensive replacement (see links at the bottom of this page). WinClean will recreate the Recent and Temp folders (see the lines which include 'md': don't forget to change those too, if your locations are different), and Windows will recreate the others as soon as they are needed.

XP

When you double-click the WinClean shortcut it will create a WinClean.cmd file in your 'All Users' Startup folder, which Windows will automatically execute next time Windows itself starts - thus deleting the folders listed.  Then WinClean.cmd  deletes itself, so it won't run on next reboot (if you're quick you might see a CMD window - don't worry, that's the plan).
 
XP works differently from Win9x, in that the command used here - 'rd' meaning Rename Directory (but effectively deleting directories in this usage) - seems to work from the 'All Users'  Startup folder before windows locks the index.dat files at the heart of the IE cache system. Although the folders deleted are of the current user profile (by default, though you can change that if you wish), it uses the 'All Users' Startup folder rather than the current user Startup folder, because only that one seems to work reliably for this (undocumented) trick. Under Win9x anything run from any of the Startup folders is already too late to tackle locked files.
 
WinClean.cmd assumes that you have accepted the standard XP locations, and uses a special command - %homedrive%%homepath%  - to jump to those locations :-
Root drive and path :
%homedrive%%homepath%
Recent documents :
recent
Temporary Files Folder :
local settings\temp
Cookies Folder :
cookies
IE History :
local settings\history
IE Temporary Internet Files :  
local settings\temporary internet files
You MUST edit them in Notepad if yours are different. And of course you can delete any you don't want to include, and add any that you do.

So, for example, if your Cookies folder was at 'C:\Documents and Settings\joebloggs\cookies', then only what is shown above is needed. It doesn't matter if your standard XP 'Homepath' location is, say, 'D:\Documents and Settings\joebloggs' - the above lines will still work. But if you've specifically changed the locations of any of the folders you want to delete away from your 'Homepath' (e.g. you have your IE cache at 'E:\temporary internet files'),  then you MUST edit them in Notepad. In that case, put in the whole location, enclosed in quotation marks.

So, for example, you might change the line saying ....

echo >>winclean.cmd rd /s/q "Local Settings\Temporary Internet Files"

to ...

echo >>winclean.cmd rd /s/q "E:\Temporary Internet Files"

If in any doubt about this 'Homepath' business, just include the whole location, inside quotes (like the example immediately above).

Remember, if you delete the index.dat files you will also lose any saved 'offline content'.  If that's not what you want, you need to stick with IE's own system, or use a more comprehensive replacement (see links at the bottom of this page). WinClean will recreate the Recent and Temp folders (see the lines which include 'md': don't forget to change those too, if your locations are different), and Windows will recreate the others as soon as they are needed.

Note for NT/W2K users. Sorry, it's quite likely this will not work for you. It appears XP has some subtle undocumented changes which give its 'All Users' Startup folders more powers than under NT/W2K. If you're interested in experimenting, you can suck it and see. But XP also uses different default locations for %homedrive% and for the usual folders listed above, so you must manually find your own locations, including your Startup folder. Enter them in full (inside quotes), and amend the %homedrive%%homepath% lines in WinClean.cmd  . Please do not use %homedrive%%homepath% unamended, because it won't find the right folders. If you're not sure how to make the locations right under NT/W2K, don't try it. Deleting whole folder trees is dangerous.

FAQ's...

1. Can I be prompted to press a key to delete any or all of the folders?
2. Can I change the Icon?
3. Can I have it run every time I start Windows?
4. What are these Deltree and RD commands all about then, eh?
5. What are Index.dat files?
6. What might old Index.dat files contain?
7. Is there anything nefarious going on by Microsoft or anyone else, with these files?
8. Does WinClean securely wipe anything it deletes? And what does securely wiping entail?
9. Milly's WinClean is wonderful, of course. But, um, are there any other freeware tools available?

 

1.  Can I be prompted to press a key to delete any or all of the folders?

Win9x

Change each line you wish from this format :
 
echo >>C:\winstart.bat deltree /y c:\windows\temp

To this format :
 
echo >>C:\winstart.bat deltree c:\windows\temp

(i.e. delete the '/y' bit)

XP

Change each line you wish from this format :
 
echo >>winclean.cmd rd /s/q "Local Settings\Temp"

To this format :
 
echo >>winclean.cmd rd /s "Local Settings\Temp"

(i.e. delete the '/q' bit)

But ... you may find that the delay caused by having it wait for a keypress, for those folders with a locked index.dat (e.g. the TIF and History and Cookie folders), will stop it working on those folders! If so, don't do that. For me, sometimes it does and sometimes it doesn't. Go figure. Hey, this is an undocumented trick, after all.

2.  Can I change the Icon?

Win9x

Just right-click on the WinClean.pif, select Properties/Program tab/Change Icon button and pick another in the usual way.  You can rename it (right-click/rename) to just WinClean too, or anything else you prefer.

XP

Just right-click on the WinClean.lnk, select Properties/Change Icon button and pick another in the usual way.  You can rename it (right-click/rename) to just WinClean too, or anything else you prefer.
3.  Can I have it run every time I start Windows?

Win9x

Open WinClean.bat with Notepad and change ('rem out')  :-
 
This line :
 
echo >>C:\winstart.bat del winstart.bat

To this :
 
rem echo >>C:\winstart.bat del winstart.bat

(or just delete the whole line, if you like).
 
But remember there are potential dangers in deleting the Temp folder at every boot  - an unfinished program installation may still need something in it.  You could delete or 'rem out' that Temp line of course.
 
If you do choose to leave it running at each startup, just double-click the WinClean shortcut again to temporarily suspend it (because it will pop up the Winstart.bat in a Notepad window - then just delete all lines to do with WinClean, and save the file). When you want to start cleaning at every boot again, just double-click the WinClean shortcut again.

XP

Open WinClean.cmd with Notepad and change ('rem out')  :-
 
This line :

echo >>winclean.cmd del "%allusersprofile%\Start Menu\Programs\Startup\winclean.cmd"

To this :
 
rem echo >>winclean.cmd del "%allusersprofile%\Start Menu\Programs\Startup\winclean.cmd"

(or just delete the whole line, if you like).
 
But remember there are potential dangers in deleting the Temp folder at every boot  - an unfinished program installation may still need something in it.  You could delete or 'rem out' that Temp line  of course.
 
N.B. If you do choose to leave it running at each startup, just double-click the WinClean shortcut again to temporarily suspend it (because it will delete WinClean.cmd and pop up a Notepad window to alert you. When you want to start cleaning at every boot again, just double-click the WinClean shortcut again. Hitting the shortcut twice like that is also a handy method of checking what is going to be set for next boot, say if you have edited the file, or forgotten what you have as default.

4.  What are these Deltree and RD and MD and Path commands all about then, eh?

Open a DOS box (click the 'Shortcut to MS-DOS' item on your start Menu, or type CMD at your Start/Run... Menu ), then into that DOS box type (or copy'n'paste) the following...

Type:      Deltree /?    or    MD/?    or    Path    (or just for XP)    RD/?

 ... and full details will be revealed.

5.  What are Index.dat files?

Index.dat: Part I - What is index.dat?

"We (the IE team) get a lot of questions about these files. The first question is often "What are they?" The answer is quite simple: Index.dat files are binary files that Internet Explorer uses to save information about URLs. They are basically hash tables that have been optimized to be very fast when dealing with URLs. Given an URL, these files map the URL to a binary blob of data. The binary blob of data is different, depending on what the particular index.dat file is used for. [...]"

Index.dat: Part II - What are they used for?

"The two primary consumers of these files are the Temporary Internet Files folder (TIF) and History. TIF uses an index.dat file to map URLs to the associated Cache file name. [...] Off-line favorites uses it to keep track of subscription information. Shortcuts use it to find the Favicon. Auto-complete uses it to create a list of options to display in the drop-down box. Link coloring in the HTML rendering engine uses the list to decide how to color any given link on the page. [...]"

Index.dat Part III - How do I delete index.dat?

"These data files are used by Internet Explorer and Windows Explorer. You cannot delete a file that is in use by a running program. If you feel you need to delete the file, you will have to shutdown all instances of Explorer and IE. This includes applications that may host the Webbrowser control: Outlook, Messenger, IE, Product Studio, Visual Studio, Help, Windows Media Player, etc. Your best bet is just close everything. When you are left with a desktop and a start menu, you will still need to shutdown Explorer. To cleanly shutdown Explorer: Start->Shutdown->CTRL+ALT+SHIFT+Click 'Cancel' (for more info, see this post). You can use Task Manager (CTRL+SHIFT+ESC, File->Run...) at this point to open a command window. You should be able to go delete the index.dat. I have only tried this on XPSP2, but it should work anywhere. [...] Yeah, it seems reasonable that some other guys might have a ref on these files. You can generally just kill them since you are going to blow the index.dat db away anyway. I use taskkill.exe and delnode.exe from the win32 sdk, which makes it much easier. My list of processes above is by no means complete and YMMV. The important thing is to shutdown everyone holding a ref. [...]"

Index.dat Part IV - It's doing what on the UI thread?


A bit about WinInet's Index.dat

"Since a recent digg article and its underlying Wikipedia entry seems a little confused about index.dat, I’d like to give some more detail about what it is and what we have changed with it in IE7/Vista’s version of WinInet. [...]"

A bit about WinInet’s Index.dat – Q&A

"In my previous post I tried to explain a bit about what the index.dat files are and what has changed in IE7/Windows Vista timeframe. The post got a couple questions that I'll attempt to answer here. [...]"

Microsoft Knowledge Base Article - 301057

"NOTE: By design, Windows Explorer uses the Desktop.ini and Index.dat files to provide the functionality of the Temporary Internet Files shell extension. Index.dat is the Internet Explorer cache index file. It facilitates the browser cache mechanism that speeds access to frequently accessed web pages across different browser processes in the same user context."
6.  What might old Index.dat files contain?
Mostly worthless and harmless pointers to pages and files which are no longer cached, but those may include full or partial URLs (web addresses), which may be 'interesting' in and of themselves, and which may contain passwords and suchlike.
7.  Is there anything nefarious going on by Microsoft or anyone else, with these files?

Nope, don't be fudgulled by all the conspiracy theories. See the links above, such as . . .

"NOTE: By design, Windows Explorer uses the Desktop.ini and Index.dat files to provide the functionality of the Temporary Internet Files shell extension. Index.dat is the Internet Explorer cache index file. It facilitates the browser cache mechanism that speeds access to frequently accessed web pages across different browser processes in the same user context. Cookies are also displayed when you view the Temporary Internet Files folder in Windows Explorer, but these files are physically stored in your Cookies folder; this is also by design."

"Cannot View Temporary Internet Files on Shared Computer

SYMPTOMS
When you try to view the Temporary Internet Files folder on a shared network drive, or in a specific user's local Temporary Internet Files folder, you may see the files in your local Temporary Internet Files folder instead.

RESOLUTION
To work around this behavior, log on to the appropriate computer locally as the user whose temporary Internet files you want to view.

STATUS
This behavior is by design."


Or here's just one of many explanations:  "Background on Index.dat by Terry Allen, Microsoft New Zealand's Technical Marketing Manager" . . .

"Index.dat is simply an index that allows Windows to find files faster. Index.dat is not content, and is only an index to the content in the cache system. It only contains the names of files that have been stored in the Temporary Internet Files folder but not the files themselves. If a user clears the browser cache, they will not be able to read web-based email without logging into the email account again. As a system file, Index.dat is hidden and cannot be readily accessed. In addition, the folder containing the actual cached pages is difficult to find as every user's machine has a uniquely named cache folder. Index.dat cannot be accessed via a website and can only be accessed by a user with local access to the PC. The Index.dat file is a documented feature of the Internet Explorer security architecture. This architecture is designed to prevent hostile web sites from being able to find content on the user's computer."

8.  Does WinClean securely wipe anything it deletes? And what does securely wiping entail?

No, it just deletes them (though it does bypass the Recycle Bin). If you need a secure wiping tool, check out the links immediately below. Read all about the implications here.

9.  Milly's WinClean is wonderful, of course. But, um, are there any other freeware tools available?
What?!  Oh, all right.  Everyone needs to find a glove that fits, I suppose.  You might try these batch files . . .
  • TIF-Clean : fully documented batch files by Eric Howes.  All OS's.
  • Batch Cleanup : fully documented batch files by Fred Langa.  Mainly Win9x, but adaptable to ME/NT/2K/XP.
  • Son of IE Cache Fix : a fully documented batch file 'managed' by the Windows Scripting Host. Win9x only, but adaptable to ME/NT/2K/XP.
  • Inuse : A command line tool by Microsoft to replace locked files on next boot. Tool and documentation. Direct download of Inuse.exe (40kb).
Or these programs which focus on 'features'. But you'll need to check how thoroughly they are deleting the 'old' URLs and/or index.dats, if that is important to you. Some of them just use IE's own mechanism to do it, and that will leave the index.dats to grow and grow forever, and often leave 'orphan' files of which IE has lost track  . . .
There are many more, and many more again at a price.  Take care though, some are atrociously poorly documented, and some peddle misinformation or trade on scare tactics and paranoia.  A more comprehensive list can be found at Eric Howes' site.
Milly

... the right to privacy and anonymity in the information age

    Home   
 Bookmarklets
       WinClean  
    Alexa    
    Google    Google-Cookie
    KaZaA    
    Tools    
    Links