Solved

in Delphi - How can I delete the contents of the temporary folder that Internet Explorer uses?

Posted on 2011-02-23
4
463 Views
Last Modified: 2012-08-14
Thanks for reading.

I simply want to delete the contents of the temporary folder that Internet Explorer uses?

This is usually:

C:\Documents and Settings\USERNAME\Local Settings\Temporary Internet Files\

but these files are kinda "special" I think...

Anyone know how to delete this folder's content?

Thanks!
0
Comment
Question by:bobbysdog
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 8

Expert Comment

by:jimsweb
ID: 34967351
The following routine deletes everything.
http://delphi.about.com/cs/adptips1999/a/bltip1199_2.htm
0
 
LVL 8

Expert Comment

by:jimsweb
ID: 34967354
This article is also dealing with temporary directories. Hope it helps.
http://stackoverflow.com/questions/503312/deleting-a-temporary-directory-in-delphi
0
 
LVL 24

Accepted Solution

by:
jimyX earned 500 total points
ID: 34967495
You can use this code from delphi.about.com:
uses
   WinInet;

procedure DeleteIECache;
var
   lpEntryInfo: PInternetCacheEntryInfo;
   hCacheDir: LongWord;
   dwEntrySize: LongWord;
begin
   dwEntrySize := 0;
   FindFirstUrlCacheEntry(nil, TInternetCacheEntryInfo(nil^), dwEntrySize) ;
   GetMem(lpEntryInfo, dwEntrySize) ;
   if dwEntrySize > 0 then lpEntryInfo^.dwStructSize := dwEntrySize;
   hCacheDir := FindFirstUrlCacheEntry(nil, lpEntryInfo^, dwEntrySize) ;
   if hCacheDir <> 0 then
   begin
     repeat
       DeleteUrlCacheEntry(lpEntryInfo^.lpszSourceUrlName) ;
       FreeMem(lpEntryInfo, dwEntrySize) ;
       dwEntrySize := 0;
       FindNextUrlCacheEntry(hCacheDir, TInternetCacheEntryInfo(nil^), dwEntrySize) ;
       GetMem(lpEntryInfo, dwEntrySize) ;
       if dwEntrySize > 0 then lpEntryInfo^.dwStructSize := dwEntrySize;
     until not FindNextUrlCacheEntry(hCacheDir, lpEntryInfo^, dwEntrySize) ;
   end;
   FreeMem(lpEntryInfo, dwEntrySize) ;
   FindCloseUrlCache(hCacheDir) ;
end;

procedure TForm1.Button1Click(Sender: TObject) ;
begin
   DeleteIECache;
end;

Open in new window

http://delphi.about.com/cs/adptips2002/a/bltip1002_2.htm
0
 

Author Closing Comment

by:bobbysdog
ID: 34967511
woo hoo thanks

p.s. i tried the other 2 solutions. they didnt work cuz the temp internet files folder is too exotic. but thank you very much for your input
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question