Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.

Deleting Microsoft's hidden web caches created by IE5

by cLive ;-) (Prior)
on Feb 15, 2002 at 05:09 UTC ( #145623=sourcecode: print w/replies, xml ) Need Help??
Category: Win32 stuff
Author/Contact Info cLive ;-) -
Description: Finds and removes those nasty "index.dat" files that IE hide on your Windows machine. For more information, see this article.
use strict;
use warnings;
use File::Find;

my $c=0;
my @files = ();

# find the files
print "Processing\n";
find(\&wanted, "/");

# offer for delete:
for (@files) {
  print "\nDelete $_?(y/n)\n";
  my $r = <STDIN>;
  if ($r =~ /y/i) {
    unlink $_;
    print "FILE DELETED!\n";

sub wanted {
  print '.' if !$c; $c++;$c%=1000;
  push @files, $File::Find::name if (/index.dat/);
Replies are listed 'Best First'.
Re: Deleting Microsoft's hidden web caches created by IE5
by Amoe (Friar) on Feb 15, 2002 at 19:58 UTC

    Small quibble - you might want to escape the dot in your file matching pattern. As I'm sure you knew, but I'm telling you to be annoying, . matches any character, whereas you probably meant:

    push @files, $File::Find::name if /index\.dat/;

    my one true love
(cLive ;-) Re: Deleting Microsoft's hidden web caches created by IE5
by cLive ;-) (Prior) on Feb 16, 2002 at 04:56 UTC
    Ah, yes, valid point. And as crazyinsomniac points out - don't try to run this in Windows - boot to DOS first! (f8 at boot, I think :)

    cLive ;-)

    -- seek(JOB,$$LA,0);

      first, you must direct the File::find to your current dir (or it will treat the target "Local setting" directory as if it is on c: root find(\&wanted, "c:\/Documents and Settings\/YourUser\/Local Settings"); second - perl cant unlink the file (locked -> permission denied"). i use overwrite, which also takes care of the undelete problem: use File::Copy; copy('c:\empty.txt',$_)||$!;
Re: Deleting Microsoft's hidden web caches created by IE5
by Anonymous Monk on Mar 25, 2003 at 01:35 UTC
    This formula is too complicated for me. But I pulled an excellent article from I had entered dir/s and dir/s/as, before using a window washer so had idea of all the sites I had visited from day one listed right there. Window washers do some good but did not get all the urlcaches but did delete a good deal from this directory. c:\windows\dir/s Go to start/run/ type in "Regedit" the "Registry Editor" will pop up, go to "Edit" click on "Find" type in "TypedURLs" then hit "Find Next. You will be taken to all the places you have typed in URLs manually. Erase any URLs that you find. DO NOT ERASE THE FOLDERS. Outlook express is another strong hold for these client Urlcaches and HP even had a list of all the sites I had down loaded and printed. Also go to "Tools" "Internet Options" "Content" "Auto Complete" and un click "Web Address" "Forms" and "User Names And Password On Forms" this will take away the memory of your name and SSN so you will no longer be able to left click and have your name and SSN appear on the form and you will no longer have a history of URLs under your address bar but there are at least two other url that will store this address for you. AL Holdings
Re: Deleting Microsoft's hidden web caches created by IE5
by zentara (Archbishop) on Feb 16, 2002 at 18:07 UTC
    After reading the article, maybe just deleting the files may not be enough, since MS might wise up and just undelete the file. So what would be a good wipe routine to run on $_ before doing the unlink? Split it into characters and replace each character with 0? Ideas?
      descartes wrote an implementation of the Orange Book's shred program, which is apparently a pretty good way of truly zapping files, if it's the contents of the file you're worried about.

      print@_{sort keys %_},$/if%_=split//,'= & *a?b:e\f/h^h!j+n,o@o;r$s-t%t#u'

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: sourcecode [id://145623]
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2023-12-10 10:28 GMT
Find Nodes?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?

    Results (39 votes). Check out past polls.