Delete temporary files on client on shutdown

  • Thread starter Thread starter barkley bees
  • Start date Start date
B

barkley bees

We would like to implement a process so that client PC's (Windows XP) will
automatically clear all temporary files (IE, Outlook, etc) upon shutdown/log
off. Is this possible to implement and distribute via a GPO? If not, can
anyone suggest a good solution for this? Thank you.

bb
 
barkley bees said:
We would like to implement a process so that client PC's (Windows XP)
will automatically clear all temporary files (IE, Outlook, etc) upon
shutdown/log off. Is this possible to implement and distribute via a
GPO? If not, can anyone suggest a good solution for this? Thank you.

bb

Here's a simple way - set up a computer shutdown script containing the
following:

-----------------------------------------------

FOR /F %%A IN ('DIR/B "C:\Documents and Settings"') DO DEL/S/F/Q
"C:\Documents and Settings\%%A\Local Settings\Temporary Internet Files\*.*"
FOR /F %%A IN ('DIR/B "C:\Documents and Settings"') DO RD/S/Q "C:\Documents
and Settings\%%A\Local Settings\Temporary Internet Files\"
 
Thanks for your reply Lawrence. I have since been told by our management
that our focus will only be on Outlook 2003 (not IE temp files). So we will
need to delete only the files in:

"C:\Documents and Settings\user\Local Settings\Temporary Internet
Files\OLK*"

The question becomes, how do you determine the OLK* folder name of any given
client (to delete is contents) since they appear to be randomly named?


"Lanwench [MVP - Exchange]"
Here's a simple way - set up a computer shutdown script containing the
following:

-----------------------------------------------

FOR /F %%A IN ('DIR/B "C:\Documents and Settings"') DO DEL/S/F/Q
"C:\Documents and Settings\%%A\Local Settings\Temporary Internet
Files\*.*"
FOR /F %%A IN ('DIR/B "C:\Documents and Settings"') DO RD/S/Q
"C:\Documents and Settings\%%A\Local Settings\Temporary Internet Files\"

Thanks for your reply Lanwench.
 
I don't suppose something like this could be added to the shutdown script:

cd %userprofile%\Local Settings\Temporary Internet Files\OLK*
del *.* /s /f /q



Barkley Bees said:
Thanks for your reply Lawrence. I have since been told by our management
that our focus will only be on Outlook 2003 (not IE temp files). So we
will need to delete only the files in:

"C:\Documents and Settings\user\Local Settings\Temporary Internet
Files\OLK*"

The question becomes, how do you determine the OLK* folder name of any
given client (to delete is contents) since they appear to be randomly
named?


"Lanwench [MVP - Exchange]"
Here's a simple way - set up a computer shutdown script containing the
following:

-----------------------------------------------

FOR /F %%A IN ('DIR/B "C:\Documents and Settings"') DO DEL/S/F/Q
"C:\Documents and Settings\%%A\Local Settings\Temporary Internet
Files\*.*"
FOR /F %%A IN ('DIR/B "C:\Documents and Settings"') DO RD/S/Q
"C:\Documents and Settings\%%A\Local Settings\Temporary Internet Files\"

Thanks for your reply Lanwench.
 
Howdie!

Barkley said:
I don't suppose something like this could be added to the shutdown script:

cd %userprofile%\Local Settings\Temporary Internet Files\OLK*
del *.* /s /f /q

How about a Group Policy that deletes the "Temporary Internet Files"
upon browser (IE) close?

CLASS USER

CATEGORY "Custom Internet Explorer Settings"

POLICY "Delete Temporary Internet Files on IE close"
KEYNAME "Software\Microsoft\Windows\CurrentVersion\Internet
Settings\Cache"
VALUENAME "Persistent"
VALUEON NUMERIC 0 VALUEOFF NUMERIC 1
END POLICY
END CATEGORY

cheers,

Florian
 
Hi Florian. Thanks for your suggesting! But our aim is only to delete
temporary Outlook 2003 files (%userprofile%\Local Settings\Temporary
Internet Files\OLK*) at log off or shutdown, not the IE cache itself.
 
Howdie!

Barkley said:
Hi Florian. Thanks for your suggesting! But our aim is only to delete
temporary Outlook 2003 files (%userprofile%\Local Settings\Temporary
Internet Files\OLK*) at log off or shutdown, not the IE cache itself.

Ah - okay. In your initial posting, you mentioned IE as well. Then
you'll have to stick with scripting.

cheers,

Florian
 
Barkley Bees said:
Thanks for your reply Lawrence. I have since been told by our
management that our focus will only be on Outlook 2003 (not IE temp
files). So we will need to delete only the files in:

"C:\Documents and Settings\user\Local Settings\Temporary Internet
Files\OLK*"

The question becomes, how do you determine the OLK* folder name of
any given client (to delete is contents) since they appear to be
randomly named?

I don't know, but since temp file folders fill up with gunk rapidly, and
these folders are *not* entirely purged within IE when you choose the option
to delete them, why not just do the easy and efficient thing and purge them
all with the command line/batch file stuff? I do this at all my client
offices.
"Lanwench [MVP - Exchange]"
Here's a simple way - set up a computer shutdown script containing
the following:

-----------------------------------------------

FOR /F %%A IN ('DIR/B "C:\Documents and Settings"') DO DEL/S/F/Q
"C:\Documents and Settings\%%A\Local Settings\Temporary Internet
Files\*.*"
FOR /F %%A IN ('DIR/B "C:\Documents and Settings"') DO RD/S/Q
"C:\Documents and Settings\%%A\Local Settings\Temporary Internet
Files\"

Thanks for your reply Lanwench.
 
Back
Top