script to clear temporary internet files

antoine_mpo

Reputable Poster
Hi List,

We use Xe html client, and we'd like to make a script (vbs, .bat) to automatically clear all the temporary internet files on our users' pc.
I developped some vbs scripts, sometimes using WMI, but don't manage to clear the temporary internet files.
Even when i try to see the content of this special folder, i don't see the files i see through windows explorer.

If someone has a solution, i'd be really interested.

Thanks for your help.
 
Try this window script.

Const TEMPORARY_INTERNET_FILES = &H20&

Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(TEMPORARY_INTERNET_FILES)
Set objFolderItem = objFolder.Self
strPath = objFolderItem.Path & "\*.*"

Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile(strPath)

Cheers,
Sombat
 
Hi Sombat,

Thanks for your help.
I used your code in my own script, to clear all files in every subfolder (when possible) of "Temporary Internet files" (using a recursive call).
It seems to work but ... it's pretty strange.
When i launch the script and look in the directory through windows explorer, all files and subfolders have disapeared (except "Content IE 5.5" and a the file index.dat in it).
But if i open IE, wich open our intranet page by default, i see files and folders re-appear in Windows explorer that have nothing to do with the intranet page displayed. I see files related to web site i visited before launching my script to clear .... I don't understand !!
Help !!
smile.gif
 
Could I ask what it is you are trying to do and if you realize the performance and bandwidth implications of removing locally cached objects?
 
Hi,

Well, we have several reasons we would like to create such a script :
- We sometimes have displaying issues (incomplete menus, strange displaying in interactive applications, ...) that are solved by IE cache cleaning.
- In many PC, the disk space allowed for IE cache can be in Gigas, and as a consequence many users have a lot of crap on their computers
- We noticed that sometimes, cleaning the IE cache makes JDE faster for web clients (or is it that it makes Windows works faster ?)

Making a script would allow us to make some cleaning automitacally during session login.

Do you think it's a bad idea ?
Do you think it could impact performance or bandwith at a significant level ?

Thanks for your help.

Rgds,
 
Back
Top