Link to home
Start Free TrialLog in
Avatar of strang
strang

asked on

how to locate the 'Temporary Internet Files' directory?

how to find 'Temporary Internet Files' directory in program and delete some files?
ASKER CERTIFIED SOLUTION
Avatar of inthe
inthe

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of inthe
inthe

note:
before deleting anything make sure the examples are returning the correct paths as you dont wanna delete your c:\ drive by mistake ;-)
Avatar of strang

ASKER

I try the code
found the registry path in my computer is 'Software\Microsoft\Windows\CurrentVersion\Internet Settings\5.0\Cache\content\' and readstring is 'CachePath'
I use IE5 in my computer, but how can I know the registry path in other computers?
and ,I want to delete cookies files in temporary directory,but I can't find them with your program.
was there not a path here:

Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\ and read the string "cache" ?
there should be..

 ok here is another method for win9* machines:

either use
const
 CSIDL_INTERNET_CACHE   = $0020;
 CSIDL_COOKIES      = $0021;

or add Shlobj to the uses section
then:

 Var
  SFolder :  pItemIDList;
  SpecialPath : Array[0..MAX_PATH] Of Char;
begin
SHGetSpecialFolderLocation(Form1.Handle, CSIDL_INTERNET_CACHE, SFolder);
SHGetPathFromIDList(SFolder, SpecialPath);
Label1.Caption := StrPas(SpecialPath);


but you  must not use that on nt without checking the return path first becuase i have problems in past with it.

did you try the second method ?
what operating system are you testing on?

also see:
http://www.euromind.com/iedelphi/ 
under urlHistory for 3 examples of getting history.
one of them was 2 method i posted here.


Listening