On Fri, Apr 11, 2008 at 2:07 PM, Micheal Espinola Jr
<[EMAIL PROTECTED]> wrote:
> The problem isnt your temp folder. Its the folder that is specified here:
>
> HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Security,
> OutlookSecureTempFolder
We use the VBScript below to clean out that folder on a semi-regular basis.
(Outlook doesn't always clean up after itself when it saves a file
to that folder. Our ERP system always uses the same file name when
generating certain reports which get emailed to other people. When
Outlook encounters the existing file name, it renames the new
attachment to "Whatever (1)", "Whatever (2)", etc. Once it hits
"Whatever (99)", Outlook starts to puke when the user tries to open
said reports.)
' PurgeOutlookTempFiles.VBS - delete contents of Outlook's "secure
temp folder" file attachment directory
'
Option Explicit
'
Const WshShellRunShow = 1
Const WshShellRunWait = True
Const dq = """"
'
Const AttachFolderRegPath =
"HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Security\OutlookSecureTempFolder"
'
Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
'
Dim AttachFolderPath
AttachFolderPath = WshShell.RegRead(AttachFolderRegPath)
'
' Make sure path contains expected sub-strings
If (InStr(AttachFolderPath, "Documents and Settings") = 0) _
Or (InStr(AttachFolderPath, "Temporary Internet Files") = 0) Then
WScript.Echo _
"Outlook attachment folder path looks strange." & vbNewLine & _
"Path = <" & AttachFolderPath & ">" & vbNewLine & _
"Aborting."
WScript.Quit
End If
'
Dim cmd
cmd = "CMD.EXE /C DEL /F/A " & dq & AttachFolderPath & dq
'
' run DEL *.* in a foreground window (so user gets prompted)
WshShell.Run cmd, WshShellRunShow, WshShellRunWait
~ Upgrade to Next Generation Antispam/Antivirus with Ninja! ~
~ <http://www.sunbelt-software.com/SunbeltMessagingNinja.cfm> ~