Deleting TempFiles/Cookies/History

doulostheou

Registered User.
Local time
Today, 13:14
Joined
Feb 8, 2002
Messages
314
Does anyone have any code that is able to delete temporary internet files, cookies, and history? With a great deal of help from Fornation, I have code that will delete all files and subfolders from a specified folder. This works great when I'm logged on as Admin and deleting other people's profiles. However, when I try to delete my own internet files, cookies, and history strange abnormalities occur. Sometimes the files get deleted, but other times certain files linger behind. I'm not sure what could be causing this, but I was wondering if I could overcome this by invoking the same sort of procedure Internet Explorer uses when deleting temp files and history.
 
This does not really sound like an abnormal behaviour. Files that cannot get deleted usually correspond to files in use at the time you try to delete them. This may explain why you sometimes manage to delete all files and sometimes not. Windows won't let you easily act upon files in use and it may have weird consequences even if you manage to.
A few other files are permanently protected by Windows and won't get deleted easily neither. This is the case of the index.dat file.

On the other hand, if you suspect that your pb may be related simply to file attributes you may want to have a look to the following thread. Use with care.


Delete files irrepective of attributes
 
Last edited:
My code already changes the attributes before deleting to remove system files. When deleting someone else's profile (also containing their temp files, etc.), the code deletes everything. But the profiles can only be deleted if you are logged in as admin, which probably removes any sharing violations. I have done further testing, and though I am sure there is some sort of logic behind it, I still find it odd. If I close internet explorer and run the function, all the files appear to be gone. If I reopen internet explorer and then go to Options/Settings/View Files my temp files reappear.

Our employees are constantly sitting at different workstations and their profiles carry all their cookies and internet files with them. These get saved on the workstation and beging to really slow down the system. We have required them to delete their cookies and temp files every night before leaving, though we constantly have people forgetting. I want to do this automatically when they close their logsheets (an Access application I designed). I'm just confused as to if the files are really there or not. I cannot figure out why they disappear and then reappear.
 
Cookies are stored in a different folder but can be view through the Internet Temporary Files window. There may be other files categories that I do not know of, that are also in this case.

Wouldn't it be a solution to set the worksations IE options to perform the deletion of temporary files automatically each time IE is closed?
 
This doesn't remove cookies and it also doesn't seem to work consistently. I noticed something else though. Assuming I have closed Internet Explorer, when I run my delete function and view the properties of the Temp Internet Files folder it says it is taking up 176 KB (the size of my index). If I go in through internet explorer and view the files through internet options, the files seem to reappear; but when I look at the properties of the Temp Internet folder again it still says 176 KB. So even though they don't appear to be gone, they don't appear to be taking up space.
 
Kris,

Using the file scripting code I gave you, I've made a breakthru and can now delete an entire directory and it's contents in one forced action. If you want a copy of the sample DB, send me a personal mail at formatian@aol.com.
 

Users who are viewing this thread

Back
Top Bottom