Removing Office Document caches with a script/GPO

Since the last few months, I have received a lot of calls regarding the Office Document Cache.

The problem only exists on one of our Windows 2012 RDS servers and  only appears when users are logged into that RDS server.

Folders containing OfficeFileCache can be deleted on the server side where I would manually delete those folders.

So my question is: Should I create a PowerShell/DOS script to automatically delete the OfficeFileCache folders from the user profiles? Or is better to create a GPO that blocks the possible culprit (MSOSYNC.EXE)?

Thanks in advance,

SP-Brown


  • Edited by SP-Brown Monday, August 24, 2015 8:40 AM
August 24th, 2015 8:32am

Hi,

According to your description, I suppose that your user account has no deleted permission in the Windows 2012 RDS servers. I'd like to explain it: When we open a Office file, it'll automatically create a temp file like ~$filename.

A temporary file is a file that is created to temporarily store   information in order to free memory for other purposes, or to act as a safety   net to prevent data loss when a program performs certain functions. For   example, Word determines automatically where and when it needs to create   temporary files. The temporary files only exist during the current session of   Word. When Word is shut down in a normal fashion, all temporary files are first   closed and then deleted.

If the user has no deleted permission, the temp file will retain. Thus, I recommend you assign the deleted permission to the user group if the policy of your organization is allowed.

More information about Office temporary files:

http://support.microsoft.com/kb/211632

Regards,

George Zhao
TechNet Community Support

Free Windows Admin Tool Kit Click here and download it now
August 26th, 2015 8:50am

Hi,

Sorry for reply delay. The OfficeFileCache is a temporary location used to sync your local cache with SharePoint when documents are updated from your client, or when you open the documents from the browser. If you sync files to the local folder from OneDrive for Business, it will also sync to the Local OfficeFileCache folder.

We can change the cache settings in Office Upload Center to set the maximum number of days to keep files in the Office Document cache as necessary. Or you can also select Delete files from the Office Document Cache when they are closed. Or modify it with registry key:

1. Delete the FileStoreCriticalError key in the user's registry key HKCU\Software\Microsoft\Office\15.0\Common\Internet
2. Delete or rename the OfficeFileCache folder in the user's profile AppData\Local\Microsoft\Office\15.0

@Echo Off
echo.

REG DELETE HKCU\Software\Microsoft\Office\15.0\Common\Internet\FileStoreCriticalError /f
RENAME "C:\Users\%username%\AppData\Local\Microsoft\Office\15.0\OfficeFileCache" 
Regards,
George Zhao
TechNet Community Support

August 31st, 2015 9:55pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics