PC Review


Reply
Thread Tools Rate Thread

Clearing Outlook temp files folder (OLK*) on shutdown?

 
 
Barkley Bees
Guest
Posts: n/a
 
      15th Feb 2008
Trying to find the best way to have XP client PC's clear their Outlook 2003
temporary folder data on system shutdown (C:\Documents and
Settings\%userprofile%\Local Settings\Temporary Internet Files\OLK*). Can
this be accomplished using Group Policy to set the "shutdown script" and use
something like the below in a .bat file:

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

Can a .bat file be assigned as a 'shutdown script' via group policy?
Appreciate any feedback or optional advice. Thank you.


 
Reply With Quote
 
 
 
 
Barkley Bees
Guest
Posts: n/a
 
      15th Feb 2008
Perhaps I should rephrase my question: can a .bat file be caused for a
shutdown script applied via Group policy or does it need to be in another
fromat (vb, etc)?

I have the following I plan to use:
----------------------------------------------------------------------------------------
@echo off
rem Delete Outlook 2003 temporary files on client Machines

if exist "%userprofile%\Local Settings\Temporary Internet Files\OLK*" (cd
"%userprofile%\Local Settings\Temporary Internet Files\OLK*") else (goto
END)
del *.* /s /f /q
goto END
:END
----------------------------------------------------------------------------------------

"Barkley Bees" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Trying to find the best way to have XP client PC's clear their Outlook
> 2003 temporary folder data on system shutdown (C:\Documents and
> Settings\%userprofile%\Local Settings\Temporary Internet Files\OLK*). Can
> this be accomplished using Group Policy to set the "shutdown script" and
> use something like the below in a .bat file:
>
> --------------------------------------------------------------------------------
> cd %userprofile%\Local Settings\Temporary Internet Files\OLK*
> del *.* /s /f /q
> --------------------------------------------------------------------------------
>
> Can a .bat file be assigned as a 'shutdown script' via group policy?
> Appreciate any feedback or optional advice. Thank you.
>



 
Reply With Quote
 
Pegasus \(MVP\)
Guest
Posts: n/a
 
      15th Feb 2008

"Barkley Bees" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Trying to find the best way to have XP client PC's clear their Outlook
> 2003 temporary folder data on system shutdown (C:\Documents and
> Settings\%userprofile%\Local Settings\Temporary Internet Files\OLK*). Can
> this be accomplished using Group Policy to set the "shutdown script" and
> use something like the below in a .bat file:
>
> --------------------------------------------------------------------------------
> cd %userprofile%\Local Settings\Temporary Internet Files\OLK*
> del *.* /s /f /q
> --------------------------------------------------------------------------------
>
> Can a .bat file be assigned as a 'shutdown script' via group policy?
> Appreciate any feedback or optional advice. Thank you.


What makes you think that OLK files reside here:
%userprofile%\Local Settings\Temporary Internet Files\OLK*?
Why do you want to delete such files?

The script you use is highly lethal: If the target folder you specify
does not exist then it will wipe just about everything on your disk!

As it happens, there is no folder called
%userprofile%\Local Settings\Temporary Internet Files\OLK*
hence your Windows installation will cease to exist when you
first run your batch file. Furthermore, although it is not strictly
necessary for the "CD" command, you should always surround
your file/folder names with double quotes if they might contain
embedded spaces. %UserProfile% does contain embedded
spaces.



 
Reply With Quote
 
Callypso
Guest
Posts: n/a
 
      15th Feb 2008
You can use BAT files as shutdown script, that's no problem.

for more information see
http://technet2.microsoft.com/window....mspx?mfr=true

In addition to that I would suggest you use the following line to clear out
temporary internet files. This will include the OLK folder and is what I use
in our network

ERASE C:\"Documents and Settings"\%USERNAME%\"Local Settings"\"Temporary
Internet Files"\*.* /q /f /s


Callypso
Network Engineer

"Barkley Bees" wrote:

> Trying to find the best way to have XP client PC's clear their Outlook 2003
> temporary folder data on system shutdown (C:\Documents and
> Settings\%userprofile%\Local Settings\Temporary Internet Files\OLK*). Can
> this be accomplished using Group Policy to set the "shutdown script" and use
> something like the below in a .bat file:
>
> --------------------------------------------------------------------------------
> cd %userprofile%\Local Settings\Temporary Internet Files\OLK*
> del *.* /s /f /q
> --------------------------------------------------------------------------------
>
> Can a .bat file be assigned as a 'shutdown script' via group policy?
> Appreciate any feedback or optional advice. Thank you.
>
>
>

 
Reply With Quote
 
Juan I. Cahis
Guest
Posts: n/a
 
      15th Feb 2008
Dear friends, but there is a problem.

I use a similar script (I downloaded it from a posting in a
newsgroup), but sometimes, some of the files in the OLK* have the read
only, or the hidden, or the system attribute set. Could you modify
your script to unset these attribute bits before?

Callypso <(E-Mail Removed)> wrote:

>You can use BAT files as shutdown script, that's no problem.
>
>for more information see:
>http://technet2.microsoft.com/window....mspx?mfr=true
>
>In addition to that I would suggest you use the following line to clear out
>temporary internet files. This will include the OLK folder and is what Iuse
>in our network
>
>ERASE C:\"Documents and Settings"\%USERNAME%\"Local Settings"\"Temporary
>Internet Files"\*.* /q /f /s
>
>
>Callypso
>Network Engineer
>
>"Barkley Bees" wrote:
>
>> Trying to find the best way to have XP client PC's clear their Outlook2003
>> temporary folder data on system shutdown (C:\Documents and
>> Settings\%userprofile%\Local Settings\Temporary Internet Files\OLK*). Can
>> this be accomplished using Group Policy to set the "shutdown script" and use
>> something like the below in a .bat file:
>>
>> --------------------------------------------------------------------------------
>> cd %userprofile%\Local Settings\Temporary Internet Files\OLK*
>> del *.* /s /f /q
>> --------------------------------------------------------------------------------
>>
>> Can a .bat file be assigned as a 'shutdown script' via group policy?
>> Appreciate any feedback or optional advice. Thank you.
>>
>>
>>

Thanks
Juan I. Cahis
Santiago de Chile (South America)
Note: Please forgive me for my bad English, I am trying to improve it!
 
Reply With Quote
 
Lanwench [MVP - Exchange]
Guest
Posts: n/a
 
      17th Feb 2008
Barkley Bees <(E-Mail Removed)> wrote:
> Trying to find the best way to have XP client PC's clear their
> Outlook 2003 temporary folder data on system shutdown (C:\Documents
> and Settings\%userprofile%\Local Settings\Temporary Internet
> Files\OLK*). Can this be accomplished using Group Policy to set the
> "shutdown script" and use something like the below in a .bat file:
>
> --------------------------------------------------------------------------------
> cd %userprofile%\Local Settings\Temporary Internet Files\OLK*
> del *.* /s /f /q
> --------------------------------------------------------------------------------
>
> Can a .bat file be assigned as a 'shutdown script' via group policy?
> Appreciate any feedback or optional advice. Thank you.


As mentioned, this won't work if that isn't the location - and the location
can vary. The commands above could do Very Scary Things to your computer.

See
http://www.groovypost.com/howto/micr...ry-olk-folder/
for info on Outlook's temp folder.

Presuming Outlook is using the normal/defaults, which are indeed in a
subfolder under temp internet files, why not delete *all* your Internet
cache files via a shutdown script? I have the following batch file running
as a GPO-applied shutdown script in most of the networks I support....I
cribbed it shamelessly from some nice stranger on the internet.

--------------------
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\"





 
Reply With Quote
 
Barkley Bees
Guest
Posts: n/a
 
      18th Feb 2008
Thanks for your reply Lanwench. I agree with the potential dangers here. We
do use a standard image which guarantees everyone has the same path but
still, you never know.

The problem is that our management doesn't want to delete the temporary
internet files, only the Outlook temp files. I will see what pushing I can
do though =). The script you posted below, was this saved as a .bat and
assigned as the shutdown script?


"Lanwench [MVP - Exchange]"
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Barkley Bees <(E-Mail Removed)> wrote:
>> Trying to find the best way to have XP client PC's clear their
>> Outlook 2003 temporary folder data on system shutdown (C:\Documents
>> and Settings\%userprofile%\Local Settings\Temporary Internet
>> Files\OLK*). Can this be accomplished using Group Policy to set the
>> "shutdown script" and use something like the below in a .bat file:
>>
>> --------------------------------------------------------------------------------
>> cd %userprofile%\Local Settings\Temporary Internet Files\OLK*
>> del *.* /s /f /q
>> --------------------------------------------------------------------------------
>>
>> Can a .bat file be assigned as a 'shutdown script' via group policy?
>> Appreciate any feedback or optional advice. Thank you.

>
> As mentioned, this won't work if that isn't the location - and the
> location can vary. The commands above could do Very Scary Things to your
> computer.
>
> See
> http://www.groovypost.com/howto/micr...ry-olk-folder/
> for info on Outlook's temp folder.
>
> Presuming Outlook is using the normal/defaults, which are indeed in a
> subfolder under temp internet files, why not delete *all* your Internet
> cache files via a shutdown script? I have the following batch file running
> as a GPO-applied shutdown script in most of the networks I support....I
> cribbed it shamelessly from some nice stranger on the internet.
>
> --------------------
> 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\"
>
>
>
>
>



 
Reply With Quote
 
Lanwench [MVP - Exchange]
Guest
Posts: n/a
 
      19th Feb 2008
Barkley Bees <(E-Mail Removed)> wrote:
> Thanks for your reply Lanwench. I agree with the potential dangers
> here. We do use a standard image which guarantees everyone has the
> same path but still, you never know.
>
> The problem is that our management doesn't want to delete the
> temporary internet files,


What on earth do they think "temporary" is supposed to mean?

> only the Outlook temp files. I will see
> what pushing I can do though =). The script you posted below, was
> this saved as a .bat and assigned as the shutdown script?


Yep. I'm sure you can massage it to do only the OL folder, but my heavens,
I'd discuss this with management. Or, in the case of the networks I support,
I would simply run my shutdown script with no discussion. I don't believe in
giving pointy-haired bosses too much information.
>
>
> "Lanwench [MVP - Exchange]"
> <(E-Mail Removed)> wrote in
> message news:(E-Mail Removed)...
>> Barkley Bees <(E-Mail Removed)> wrote:
>>> Trying to find the best way to have XP client PC's clear their
>>> Outlook 2003 temporary folder data on system shutdown (C:\Documents
>>> and Settings\%userprofile%\Local Settings\Temporary Internet
>>> Files\OLK*). Can this be accomplished using Group Policy to set the
>>> "shutdown script" and use something like the below in a .bat file:
>>>
>>> --------------------------------------------------------------------------------
>>> cd %userprofile%\Local Settings\Temporary Internet Files\OLK*
>>> del *.* /s /f /q
>>> --------------------------------------------------------------------------------
>>>
>>> Can a .bat file be assigned as a 'shutdown script' via group policy?
>>> Appreciate any feedback or optional advice. Thank you.

>>
>> As mentioned, this won't work if that isn't the location - and the
>> location can vary. The commands above could do Very Scary Things to
>> your computer.
>>
>> See
>> http://www.groovypost.com/howto/micr...ry-olk-folder/
>> for info on Outlook's temp folder.
>>
>> Presuming Outlook is using the normal/defaults, which are indeed in a
>> subfolder under temp internet files, why not delete *all* your
>> Internet cache files via a shutdown script? I have the following
>> batch file running as a GPO-applied shutdown script in most of the
>> networks I support....I cribbed it shamelessly from some nice
>> stranger on the internet. --------------------
>> 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\"




 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Clearing temp files Karen F Windows Vista General Discussion 40 16th May 2010 03:06 PM
Clearing Outlook temp files folder (OLK*) on shutdown? Barkley Bees Windows XP General 7 19th Feb 2008 03:55 AM
Clearing temp files for all users at the same time =?Utf-8?B?a2pmcmV5NTU=?= Windows XP General 6 14th Apr 2006 02:58 PM
Auto clearing of temp files Jim Wood Windows XP Internet Explorer 1 8th Sep 2004 11:21 PM
clearing temp files ELLIOTT Windows XP General 5 3rd Dec 2003 10:29 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:08 PM.