I have created the following simple VB script file, attempting to automate the deletion of All Cookies. But the results is that whilst browsing from Window's Explorer, I can't see any cookies files, looking at IE5's Tools->Internet Options->Settings->View Files, I could still see all cookies and temporary files?? What's wrong? How could i delete all files. Something wrong with IE??
Code:
Dim fso
Dim folder
Set fso = WScript.CreateObject("Scripting.FileSystemObject")
Set folder = fso.getfolder("c:\winnt\profiles\lamp\Local Settings\Temporary Internet Files")
delAllFolders(folder)
Set folder = fso.getfolder("c:\winnt\profiles\lamp\Cookies")
delAllFolders(folder)
Set folder = fso.getfolder("c:\winnt\Temporary Internet Files")
delAllFolders(folder)
Private Sub delAllFolders(myFolder)
Dim myFolders
Dim eachFolder
Set myFolders = myFolder.SubFolders
delAllFiles(myFolder)
For each eachFolder in myFolders
delAllFolders(eachFolder)
Next
end Sub
Private Sub delAllFiles(myFolder)
Dim myFiles
Dim eachFile
Dim tmp
Set myfiles= myFolder.files
For each eachFile In myFiles
if (eachFile.Name <> "index.dat") and not(eachFile.Attributes and 1) Then
'tmp= myFolder.Name & "--" & eachFile.Name & "-" & eachFile.Attributes
' MsgBox tmp
eachFile.Delete
end if
Next
End Sub