#188685 - 2008-07-1011:33 PMClearout the OutlookSecureTempFolder to prevent Unable to Save File errors
NTDOCNTDOC Administrator
Registered: 2000-07-28
Posts: 11628
Loc: CA
This script is designed to clean out the OutlookSecureTempFolder which can cause issues for users trying to launch or save files if this folder already has files with the same name saved there, and/or the folder is filling up. Currently this affects both Microsoft Outlook 2003 and 2007 and there does not appear to be a fix from Microsoft for it yet. I have supplied links to some MS KB articles that discuss it further.
Deleting these temporary files corrects the issue.
#188687 - 2008-07-1011:43 PMRe: Clearout the OutlookSecureTempFolder to prevent Unable to Save File errors
[Re: NTDOC]
KdyerKdyer
KiX Supporter
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Doc..
Looks like a great script..
I think you can clean up a bit of the script.
From:
Code:
Select
Case KeyExist($BaseKey+'12.0\Outlook\Security')
$OLTempFolder = ReadValue($BaseKey+'12.0\Outlook\Security','OutlookSecureTempFolder')
$RC = ClearOutlookTemp(3)
Case KeyExist($BaseKey+'11.0\Outlook\Security')
$OLTempFolder = ReadValue($BaseKey+'11.0\Outlook\Security','OutlookSecureTempFolder')
$RC = ClearOutlookTemp(3)
Case KeyExist($BaseKey+'10.0\Outlook\Security')
$OLTempFolder = ReadValue($BaseKey+'10.0\Outlook\Security','OutlookSecureTempFolder')
$RC = ClearOutlookTemp(3)
Case KeyExist($BaseKey+'9.0\Outlook\Security')
$OLTempFolder = ReadValue($BaseKey+'9.0\Outlook\Security','OutlookSecureTempFolder')
$RC = ClearOutlookTemp(3)
Case 1
;Unable to locate the folder path so exit the script and set error to 3
$OLTempFolder = ""
Exit 3
EndSelect
To:
Code:
; -- Determine version of Outlook
$exe=ReadValue('HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths\OUTLOOK.EXE','')
$ver=SPLIT(GetFileVersion($exe),'.')[0]+'.0'
$OLTempFolder = ReadValue($BaseKey+$ver+'\Outlook\Security','OutlookSecureTempFolder')
$RC = ClearOutlookTemp(3)
#188688 - 2008-07-1011:51 PMRe: Clearout the OutlookSecureTempFolder to prevent Unable to Save File err
[Re: Kdyer]
NTDOCNTDOC Administrator
Registered: 2000-07-28
Posts: 11628
Loc: CA
Thanks Kent,
Yeah it could probably be golfed down and needs to have remote admin ability added as well. If I get time I'll look at your suggestion and the Remote Admin script ability for cleaning remote systems.
Though the remote portion might be a bit more difficult since HKCU can not be read directly.
#188690 - 2008-07-1011:59 PMRe: Clearout the OutlookSecureTempFolder to prevent Unable to Save File err
[Re: NTDOC]
MartMart KiX Supporter
Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Nice one Doc. Thumbs up for this one.
I see future use for this one (have to get a new job first) to just clear some outlook "junk" at scheduled times as an admin script or a not synch-ed logon script cause otherwise logon might take some time.
#188717 - 2008-07-1201:31 AMRe: Clearout the OutlookSecureTempFolder to prevent Unable to Save File err
[Re: Glenn Barnas]
NTDOCNTDOC Administrator
Registered: 2000-07-28
Posts: 11628
Loc: CA
Was thinking a couple of ways of doing the Remote portions.
1. WMI remote execute to read the registry and get the location. 2. Since WMI may not work properly on all systems maybe just do a dir scan for the folders on the system. In all cases I've seen it is always OLK?
#188721 - 2008-07-1307:59 AMRe: Clearout the OutlookSecureTempFolder to prevent Unable to Save File err
[Re: NTDOC]
KdyerKdyer
KiX Supporter
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
That is the way that I have seen it.
Know what is funny? I don't throw out that much work e-mail. I archive it.. I don't give anybody my work e-mail address unless I am working directly with a client. But, no subscriptions, registrations, etc. Those go my other e-mail addresses..