Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2011-02-23
4
Medium Priority
?
494 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 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

610 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