Why Microsoft Word and Excel Create Temporary TMP Files on a File Server
Question details
The user needs to understand why Microsoft Word and Excel create temporary TMP and lock files on a file server, and how to safely identify, troubleshoot, and remove leftover files.

- Product
- Microsoft Word and Excel
- Device & OS
- not provided
- Scenario
- Users edit Word and Excel documents stored on a shared file server, and TMP or lock files appear during editing sessions.
- Observed behavior
- Temporary files normally are removed after a clean editing session, but in some environments they remain and may keep the original user as owner.
Before deleting any TMP or lock file, confirm that no user has the document open and note the file owner. Open File Explorer with hidden items enabled so you can see temporary files such as ~$filename.docx and filename.tmp.
Check Office Version, File Locations, Permissions, and Antivirus to Find Why TMP Files Remain
Use this first when temporary or lock files remain after Word or Excel closes, so you can identify the underlying cause before deleting anything.
Word and Excel normally remove temporary and lock files after a clean editing session. Persistent TMP files often point to an Office version mismatch, restricted server permissions, antivirus scanning, or an add-in that interferes with cleanup.
In Word or Excel, click File > Account > Product Information and record whether Microsoft 365 Apps for enterprise or Office 2016 is installed.
Create a new Word or Excel file in another folder on the same file server, edit it, close it, and note whether the issue affects all files or only specific documents.
Right-click the server folder, choose Properties > Security, and confirm that users have Modify or Full control. Then check antivirus logs to see whether real-time scanning locks TMP files.
Press Windows + R, type winword /safe or excel /safe, and open the file server document. Close it and check whether TMP files are removed normally.

Take Ownership and Delete Leftover TMP Files from the File Server
Use this only after users have closed the documents and you still need to free space or remove orphaned lock files.
Avoid Recurring Microsoft Office TMP Cleanup with WPS Office
WPS Office is a free, lightweight Microsoft Office alternative that opens and saves Word and Excel documents with familiar editing tools. It supports .docx and .xlsx formats and keeps the interface familiar, making migration from Microsoft Office easy while reducing dependency on Microsoft Office-specific file-server issues.

Frequently Asked Questions
Why does Microsoft Office create temporary TMP files on a file server?
Office applications create temporary files to hold unsaved changes, ownership, and lock status while a document is open. Normally they are deleted when the file is closed cleanly, but abnormal shutdowns, add-ins, antivirus, or permissions can leave them behind.
What does a file named ~$filename.docx mean?
Files that start with ~$ are lock files created by Word or Excel when a document is opened. They tell Office who is editing the file and should be removed automatically after a normal close.
Can I delete leftover TMP files if access is denied?
Yes, after you confirm the source document is closed. Use Properties > Security > Advanced to take ownership of the file or folder, grant Full control to the administrator, and then delete the TMP or lock file.
Will WPS Office create the same temporary files on a file server?
WPS Office can create recovery-related temporary files, but it supports Word and Excel formats and offers a free, lightweight alternative if Microsoft Office lock-file cleanup becomes a recurring problem.




