dont
Fri Jan 28 23:08:07 CST 2005
"mr unreliable" <ReplyToNewsgroup@notmail.com> writes:
>hi Don,
>You may have to stoop to using visual basic, rather than vbs.
Well, perhaps surprisingly, I am making a little progress here:
Rem How Can I Delete the Files in the Temporary Internet Files Folder?
Rem www.microsoft.com/technet/scriptcenter/resources/qanda/nov04/hey1102.mspx
Const TEMPORARY_INTERNET_FILES = &H20&
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(TEMPORARY_INTERNET_FILES)
Set objFolderItem = objFolder.Self
For each folderitem in objFolder.items
If Left(folderitem.name,6)="Cookie" Then
MsgBox "Found cookie: " & folderitem.name
Rem and now for the bit that isn't quite working yet
If folderitem.name="Cookie:don taylor@atwola.com/" Then
strPath = objFolderItem.Path & "\" & folderitem.name
MsgBox "Going to delete: " & strPath
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile(strPath)
End If
Rem
End If
next
MsgBox list
So in vbscript I am able to reach in and see the cookies,
that is substantially further than I had gotten before.
And I have made the same progress with the Cookies folder.
As soon as I figure out what I'm doing wrong with the naming
for DeleteFile I might be onto something.
Then I'll add in the
If haven't seen this cookie before Then
prompt for which list to put it in
End If
If cookie is in good list Then
ignore it
Else If cookie is in bad list Then
delete it
End If
>There is sample code for doing this to be found on several sites:
> vbAccelerator (Steve McMahon)
> vbNet (Randy Birch)
> vbBox (Klaus Probst)
>Look for "Internet Cache Utility".
Thanks, I'll go hunting.
"Windows Scripting Secrets" by Weltner is a little old but was helpful.
>You might also find this interesting:
>
http://www.microsoft.com/windows/ie/using/howto/customizing/clearcache.mspx
>(entitled "How and Why to Clear Your Cache")
How often I want to dump everything isn't quite what I meant.
>cheers, jw
>"Don Taylor" <dont@agora.rdrop.com> wrote in message
>news:pvGdnXYn9cVtTWrcRVn-rg@scnresearch.com...
>> Dim Shell, wsh
>> Set wsh = Wscript.CreateObject("Wscript.Shell")
>> Set Shell = Wscript.CreateObject("Shell.Application")
>> Shell.Open "D:\Documents and Settings\dont\Local Settings\Temporary Internet Files"
>>
>> Works, wonderful!
>>
>> Now, is there some way in the script I can reach into that window,
>> grab a row of information at a time, get it into a variable, and
>> then reach back in and delete an item if it matches my criteria?
>>
>> Since TIF is a "virtual folder" I can't find any way that the usual
>> file system access tools will let me see this information and be
>> able to access the files later for deletion.
>>
>> Thanks