Fix Microsoft Outlook Cant Create File Attachment Issue
Oct 14th, 2007 by MrGroove
Recently while using Microsoft Outlook, I ran into a strange problem while trying to open an attachment that was inside an email. Each time I tried to open the attachment from the email I would get the error message: "Can’t create file: groovypost.doc. Right-click the folder you want to create the file in, and then click Properties on the shortcut menu to check your permissions for the folder."
Here’s a screen shot of the error message:

Fortunately, the fix is easy! But first, a little background information on the problem.
Scenario:
The user opens email attachments with the same name multiple times over a period of time as a result of a particular job function and/or workflow. (i.e. The user is mailed or accesses a public folder with email notifications that contain the same attachment name which they must open on a continual basis through Outlook to view.)
Every time an email attachment is opened Outlook creates a cached copy of the attachment within an Outlook temporary OLK folder. This folder is generated with a random name and therefore is different for every user. The location can be found by viewing the registry key from the user’s profile based on their Outlook version. I wrote a post earlier on how to Find the Microsoft Outlook Temporary OLK Folder. Take a look there for a MAP which details the location of the OLK folder for all versions of Outlook.
Solution:
Browse to the Outlook Temp OLK foder (also knows as the OutlookSecureTempFolder) and delete all files matching the “<attachment name>(number)”. Typically the list of cached attachments are not cleared out automatically and have reached the number of (99). Due to long file names, the cached attachment name is not able to grow any higher and therefore file creation fails and notification is sent to the user (hence the error message). Once the cached files are cleared out and Outlook is restarted, the user should once again be able to open the attachments.
FYI - As a security measure, I recommend you delete ALL files in the OLK folder regularly OR, encrypt the entire folder using Microsoft EFS.
Groovy ehh???
Questions or Comments let me know here or in the forum!
Tags: client, microsoft outlook
Visitor Options

REM OLK_PURGER.BAT by Inferno999
REM This batch file will Scan the registry for all SecureTempFolder locations
REM and purge the folder to allow room for temp items to be created.
REM Each query returns errorlevel 1 if the key is not found or a 0 if it is,
REM at which point it deletes the referenced location.
@echo off
:12
REG QUERY HKEY_CURRENT_USER\Software\Microsoft\Office\12.0
ECHO %ERRORLEVEL%
IF %ERRORLEVEL%==0 (
for /f “tokens=2,*” %%a in (’”reg query HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Outlook\Security /v OutlookSecureTempFolder|find “OutlookSecureTempFolder” “‘) do (
rmdir /s /q “%%b”
)
) ELSE (
GOTO 11
)
:11
REG QUERY HKEY_CURRENT_USER\Software\Microsoft\Office\11.0
ECHO %ERRORLEVEL%
IF %ERRORLEVEL%==0 (
for /f “tokens=2,*” %%a in (’”reg query HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Security /v OutlookSecureTempFolder|find “OutlookSecureTempFolder” “‘) do (
rmdir /s /q “%%b”
)
) ELSE (
GOTO 10
)
:10
REG QUERY HKEY_CURRENT_USER\Software\Microsoft\Office\10.0
ECHO %ERRORLEVEL%
IF %ERRORLEVEL%==0 (
for /f “tokens=2,*” %%a in (’”reg query HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Outlook\Security /v OutlookSecureTempFolder|find “OutlookSecureTempFolder” “‘) do (
rmdir /s /q “%%b”
)
) ELSE (
GOTO 9
)
:9
REG QUERY HKEY_CURRENT_USER\Software\Microsoft\Office\9.0
ECHO %ERRORLEVEL%
IF %ERRORLEVEL%==0 (
for /f “tokens=2,*” %%a in (’”reg query HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Outlook\Security /v OutlookSecureTempFolder|find “OutlookSecureTempFolder” “‘) do (
rmdir /s /q “%%b”
)
) ELSE (
GOTO end
)
:end
Scratch that.
Threw another for loop in there to reduce size and clutter:
REM OLK_PURGER.BAT by Inferno999
REM This batch file will Scan the registry for all SecureTempFolder locations
REM and purge found folders, allowing room for temp items to be created.
REM Each query returns errorlevel 1 if the key is not found or a 0 if it is,
REM at which point it deletes the referenced location.
@echo off
SetLocal EnableDelayedExpansion
for /f %%Q in (”12″,”11″,”10″,”9″) do (
REG QUERY HKEY_CURRENT_USER\Software\Microsoft\Office\%%Q.0
ECHO !ErrorLevel!
IF !ErrorLevel!==0 (
for /f “tokens=2,*” %%a in (’”reg query HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Outlook\Security /v OutlookSecureTempFolder|find “OutlookSecureTempFolder” “‘) do (
rmdir /s /q “%%b”
)
)
)
EndLocal
Inferno999,
This is awesome. However, the short version does not work for Office 2003 (and likely for older) due to hardcoded “12.0″ in the reg query.
My users often have the problem with many AS/400 reports that are distributed daily as attachements with same name.
Thanks.
SM
I looked at the registry and found the OLK location. When I went to looked for it I coild not find the OLK folder. Not sure what to do next. Thanks!
@Jon - Welcome to the site!
Hi Jon, did you try to just cut and paste the location found in the registry into the RUN command box? Click Start Button, Run, Paste in OLK location found in the registry. What happens? Does it open or?
You running Vista or XP?
Hi
Thanks for the tip - just following through the steps has helped me resolve my Outlook problems of opening word attachment files from a particular user . Good stuff.
Marc
Re: Inferno999
you code there how do i implement that? in the registry or in a bat file? please let me know id love to use it.