Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - How to clear the cache of Internet Explorer using the VB Script?

Reply
 
Old 06-05-2008   #1 (permalink)
PK


 
 

How to clear the cache of Internet Explorer using the VB Script?

Hi,

Can anyone tell me the procedure to clear the cache and to delete the
cookies of the internet explorer using the VB Script file?

Thanks,

PK

My System SpecsSystem Spec
Old 06-07-2008   #2 (permalink)
hb21l6


 
 

Re: How to clear the cache of Internet Explorer using the VB Script?


"PK" <PK@xxxxxx> wrote in message
news:9B043917-EDEF-4F3C-8F4F-36E839F8D382@xxxxxx
Quote:

> Hi,
>
> Can anyone tell me the procedure to clear the cache and to delete the
> cookies of the internet explorer using the VB Script file?
>
> Thanks,
>
> PK
>


Const TEMPORARY_INTERNET_FILES = &H20&
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(TEMPORARY_INTERNET_FILES)
Set objFolderItem = objFolder.Self
strPath = objFolderItem.Path & "\*.*"
strPath1 = objFolderItem.Path & "\Content.IE5\"
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile(strPath)
on error resume next
'------------------------------------------------------------------
' loop 1 to delete the folders that start with a number
For I = 0 to 9
' used to see the script running
'Wscript.Echo strPath1 & I & "*"
objFSO.DeleteFolder(strPath1 & I & "*")
next
'------------------------------------------------------------------
' loop 2 to delete the folders that start with a letter
For I = 1 to 26
if I = 1 then u = "A" end if
if I = 2 then u = "B" end if
if I = 3 then u = "C" end if
if I = 4 then u = "D" end if
if I = 5 then u = "E" end if
if I = 6 then u = "F" end if
if I = 7 then u = "G" end if
if I = 8 then u = "H" end if
if I = 9 then u = "I" end if
if I = 10 then u = "J" end if
if I = 11 then u = "K" end if
if I = 12 then u = "L" end if
if I = 13 then u = "M" end if
if I = 14 then u = "N" end if
if I = 15 then u = "O" end if
if I = 16 then u = "P" end if
if I = 17 then u = "Q" end if
if I = 18 then u = "R" end if
if I = 19 then u = "S" end if
if I = 20 then u = "T" end if
if I = 21 then u = "U" end if
if I = 22 then u = "V" end if
if I = 23 then u = "W" end if
if I = 24 then u = "X" end if
if I = 25 then u = "Y" end if
if I = 26 then u = "Z" end if

' used to see the script running
'Wscript.Echo strPath1 & u & "*"
objFSO.DeleteFolder(strPath1 & u & "*")
next

My System SpecsSystem Spec
Old 06-07-2008   #3 (permalink)
Pegasus \(MVP\)


 
 

Re: How to clear the cache of Internet Explorer using the VB Script?


"PK" <PK@xxxxxx> wrote in message
news:9B043917-EDEF-4F3C-8F4F-36E839F8D382@xxxxxx
Quote:

> Hi,
>
> Can anyone tell me the procedure to clear the cache and to delete the
> cookies of the internet explorer using the VB Script file?
>
> Thanks,
>
> PK
Here is a somewhat tightened up version of the idea presented by hb21:

Const TEMPORARY_INTERNET_FILES = &H20&
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(TEMPORARY_INTERNET_FILES)
objFSO.DeleteFile(objFolder.Self.Path & "\*.*")

sPath = objFSO.GetFolder(objFolder.Self.path) & "\Content.IE5\"
Set objFolders = objFSO.GetFolder(sPath)
For Each objFName In objFolders.SubFolders
WScript.Echo sPath & objFName.Name
objFSO.DeleteFolder(sPath & objFName.Name)
Next


My System SpecsSystem Spec
Old 06-07-2008   #4 (permalink)
hb21l6


 
 

Re: How to clear the cache of Internet Explorer using the VB Script?


"Pegasus (MVP)" <I.can@xxxxxx> wrote in message
news:OuMPPUIyIHA.5716@xxxxxx
Quote:

>
> "PK" <PK@xxxxxx> wrote in message
> news:9B043917-EDEF-4F3C-8F4F-36E839F8D382@xxxxxx
Quote:

>> Hi,
>>
>> Can anyone tell me the procedure to clear the cache and to delete the
>> cookies of the internet explorer using the VB Script file?
>>
>> Thanks,
>>
>> PK
>
> Here is a somewhat tightened up version of the idea presented by hb21:
>
> Const TEMPORARY_INTERNET_FILES = &H20&
> Set objFSO = CreateObject("Scripting.FileSystemObject")
> Set objShell = CreateObject("Shell.Application")
> Set objFolder = objShell.Namespace(TEMPORARY_INTERNET_FILES)
> objFSO.DeleteFile(objFolder.Self.Path & "\*.*")
>
> sPath = objFSO.GetFolder(objFolder.Self.path) & "\Content.IE5\"
> Set objFolders = objFSO.GetFolder(sPath)
> For Each objFName In objFolders.SubFolders
> WScript.Echo sPath & objFName.Name
> objFSO.DeleteFolder(sPath & objFName.Name)
> Next
>
Nice, I like it,, much neater then mine :O)




My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
RE: How can I manually clear the cache ? Vista General
RE: How can I manually clear the cache ? Vista General
where is Internet Explorer Cache located? Vista General
where is Internet Explorer Cache located? Vista file management
How do I clear the Client Side Cache (CSC) Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46