
Deleting Temp Internet files, new approach ?
I am so new at this that I love, and have to rely on Brute Force. I am sure
there is a more elegent way to script this, but it works for me and does not
seem to do harm. But then again..........
This manhandles the cookies too.
Jerry
'***************************************************************************
****************
'***************************************************************************
****************
'Step 5: Delete the Temporary Internet files and folders in the C:\Documents
and Settings\"USERNAME"\Local Settings\Temporary Internet Files folder.
'Deletes and removes temporary Internet files and folders.
'Any files in use by the system will not be deleted.
'Checks to see if folder is there.
On Error Resume Next
If filesys.FolderExists("C:\Documents and Settings\" & WshNetwork.username &
"\Local Settings\Temporary Internet Files\") Then
'Forces deletion of files and subfolders not in use.
filesys.DeleteFile ("C:\Documents and Settings\" & WshNetwork.username &
"\Local Settings\Temporary Internet Files\*.*"), True
filesys.DeleteFolder ("C:\Documents and Settings\" & WshNetwork.username &
"\Local Settings\Temporary Internet Files\*.*"), True
filesys.DeleteFile ("C:\Documents and Settings\" & WshNetwork.username &
"\Local Settings\Temporary Internet Files\Content.IE5\*.*"), True
filesys.DeleteFolder ("C:\Documents and Settings\" & WshNetwork.username &
"\Local Settings\Temporary Internet Files\Content.IE5\*.*"), True
On Error GoTo 0
End If
'***************************************************************************
****************
'***************************************************************************
****************
'Step 7: Deletes the Cookies if you want to.
'Input from previous Message Box determines deletion
If Cookies = vbYes Then
On Error Resume Next
'ilesys.DeleteFile ("C:\Documents and Settings\" & WshNetwork.username &
"\Cookies\*.*"), True
filesys.DeleteFile ("C:\Documents and Settings\Default User\Cookies\*.*"),
True
On Error GoTo 0
Else
End If
Quote:
> Al,
> I don't think there *is* a more elegant way. In fact, I think the
solution used
> by inetcpl.cpl (the Internet Options applet) is just the brute force
method
> applied to deleting everything but cookies from the current user's listed
> Temporary Internet Files location.
> > I want to delete Temporary Internet flies like a lot of
> > people, but have not found a good soloution to do it
> > automatically (on Windows 2000). All methodes seam to
> > focus on brute force. What about a script that basically
> > does what we would do when we manually delete them from
> > contol panel\Internet Properties ?