I am looking for a way to delete the internet cache files via a script,
without deleting cookies. I have a website which is being upgraded, and the
new version crashes due to old internet cache files that are not refreshed
properly.

Deleting the cache files corrects the problem, but I want to avoid having
each user do this when they access the app after the upgrade, as it will
generate a lot of calls for our help desk.

IE is already configured to check for new files on every visit to the page,
but this is not working in this case.

We could simply delete the contents of everyone's temporary internet files,
but this would remove their cookies and all their favorite settings would be
lost. This would upset some users, and politically be a bad move, so it is
not really an option.

I was hoping there would be some way to script this so we could delete all
of the cache files, excluding offline content and cookies, just like you do
from the Tools, Internet Options, Delete Files.

Does anyone know of a way to do this?

Re: Script to Delete Internet Cache Files? by Bill

Bill
Sun Feb 25 00:20:39 CST 2007

Why do you think deleting files from TIF effects cookies? Yes, cookies =
are visible there when viewed in Windows Explorer, but it's a smoke and =
mirrors situation. You can confirm that by navigating to the folder =
from a command prompt and doing dir /a.

Here is a script I use for this. Hopefully the line wrap in newsreader =
won't screw it up too bad:


' CleanTIF.vbs - Bill James - 21 Oct 2006
' Deletes all files from current users Temporary Internet Files folder, =
unless file is locked.
' Nothing fancy, just calls the command line delete, but scripting =
allows getting the users TIF
' Options
' cmdOpt: "/c" or "/k". Use "/k" to keep the command prompt window =
open after processing.
' show: 0 or 1. Use 0 to hide the command prompt window (if show is =
set to 0, cmdOpt is
' always /c)
' wait: True or False. Use True to make script wait until command =
completes (if show is set
' to 0, wait is always False)

Option Explicit
Dim cmdOpt, show, wait
cmdOpt =3D "/c"
show =3D 1
wait =3D True


Dim fld, tif
Set fld =3D CreateObject("Shell.Application").NameSpace(&H20)
tif =3D Chr(34) & fld.Self.Path & "\content.ie5" & Chr(34)
If show =3D 0 Then
cmdOpt =3D "/c"
wait =3D False
End If
CreateObject("WScript.Shell").Run "%comspec% " & cmdOpt & " del " & tif =
& " /f /s /q", show, wait




--=20

Bill James


"Jim Underwood" <james.underwoodATfallonclinic.com> wrote in message =
news:ej5ta24VHHA.4624@TK2MSFTNGP03.phx.gbl...
>I am looking for a way to delete the internet cache files via a script,
> without deleting cookies. I have a website which is being upgraded, =
and the
> new version crashes due to old internet cache files that are not =
refreshed
> properly.
>=20
> Deleting the cache files corrects the problem, but I want to avoid =
having
> each user do this when they access the app after the upgrade, as it =
will
> generate a lot of calls for our help desk.
>=20
> IE is already configured to check for new files on every visit to the =
page,
> but this is not working in this case.
>=20
> We could simply delete the contents of everyone's temporary internet =
files,
> but this would remove their cookies and all their favorite settings =
would be
> lost. This would upset some users, and politically be a bad move, so =
it is
> not really an option.
>=20
> I was hoping there would be some way to script this so we could delete =
all
> of the cache files, excluding offline content and cookies, just like =
you do
> from the Tools, Internet Options, Delete Files.
>=20
> Does anyone know of a way to do this?
>=20
>

Re: Script to Delete Internet Cache Files? by Jim

Jim
Tue Feb 27 15:52:52 CST 2007

That worked like a champ. Thanks.

It is good to know that the cookies and some of the other files are not
really where they appear to be when viewed through explorer.

"Bill James" <wgjames@mvps.org> wrote in message
news:OguSVUKWHHA.3980@TK2MSFTNGP02.phx.gbl...
Why do you think deleting files from TIF effects cookies? Yes, cookies are
visible there when viewed in Windows Explorer, but it's a smoke and mirrors
situation. You can confirm that by navigating to the folder from a command
prompt and doing dir /a.

Here is a script I use for this. Hopefully the line wrap in newsreader
won't screw it up too bad:


' CleanTIF.vbs - Bill James - 21 Oct 2006
' Deletes all files from current users Temporary Internet Files folder,
unless file is locked.
' Nothing fancy, just calls the command line delete, but scripting allows
getting the users TIF
' Options
' cmdOpt: "/c" or "/k". Use "/k" to keep the command prompt window open
after processing.
' show: 0 or 1. Use 0 to hide the command prompt window (if show is set
to 0, cmdOpt is
' always /c)
' wait: True or False. Use True to make script wait until command
completes (if show is set
' to 0, wait is always False)

Option Explicit
Dim cmdOpt, show, wait
cmdOpt = "/c"
show = 1
wait = True


Dim fld, tif
Set fld = CreateObject("Shell.Application").NameSpace(&H20)
tif = Chr(34) & fld.Self.Path & "\content.ie5" & Chr(34)
If show = 0 Then
cmdOpt = "/c"
wait = False
End If
CreateObject("WScript.Shell").Run "%comspec% " & cmdOpt & " del " & tif & "
/f /s /q", show, wait




--

Bill James


"Jim Underwood" <james.underwoodATfallonclinic.com> wrote in message
news:ej5ta24VHHA.4624@TK2MSFTNGP03.phx.gbl...
>I am looking for a way to delete the internet cache files via a script,
> without deleting cookies. I have a website which is being upgraded, and
the
> new version crashes due to old internet cache files that are not refreshed
> properly.
>
> Deleting the cache files corrects the problem, but I want to avoid having
> each user do this when they access the app after the upgrade, as it will
> generate a lot of calls for our help desk.
>
> IE is already configured to check for new files on every visit to the
page,
> but this is not working in this case.
>
> We could simply delete the contents of everyone's temporary internet
files,
> but this would remove their cookies and all their favorite settings would
be
> lost. This would upset some users, and politically be a bad move, so it
is
> not really an option.
>
> I was hoping there would be some way to script this so we could delete all
> of the cache files, excluding offline content and cookies, just like you
do
> from the Tools, Internet Options, Delete Files.
>
> Does anyone know of a way to do this?
>
>