Author: Tomas Rutkauskas
How can I delete the contents of the IE5 History folder? I know that it is a
Special Folder, so do you need to run this process as the system? If so how?
Answer:
This will get you the history folder and then maybe you can use the DeleteFile
function to delete all the files in the directory.
1 uses2 ShlObj;
3 4 procedure TForm1.Button1Click(Sender: TObject);
5 const6 CSIDL_HISTORY = $0022; {no need to define if using Delphi 5}7 var8 pidl: PItemIDList;
9 Path: array[0..MAX_PATH - 1] of char;
10 begin11 {get location of history folder}12 if SHGetSpecialFolderLocation(Self.Handle, CSIDL_HISTORY, pidl) = NOERROR then13 begin14 SHGetPathFromIDList(pidl, Path);
15 ShowMessage(Path);
16 end;
17 end;