| |
drkesrel
Posts: 11
Score: 0
Joined: 5/23/2001
From: USA
Status: offline
|
I have created the following simple VB script file, attempting to automate the deletion of All Cookies and Temporary Internet Files. 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. What's wrong? Dim fso Dim folder Set fso = WScript.CreateObject("Scripting.FileSystemObject") Set folder = fso.getfolder("c:\winnt\profiles\userID\Local Settings\Temporary Internet Files") delAllFolders(folder) Set folder = fso.getfolder("c:\winnt\profiles\userID\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
|
|